Eli says this should check MicrosoftMode instead.

Also change a || that I accidentally changed to && back to ||.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148677 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp
index 1371b35..983e815 100644
--- a/lib/Sema/SemaDeclCXX.cpp
+++ b/lib/Sema/SemaDeclCXX.cpp
@@ -7852,8 +7852,8 @@
   //   there is no user-declared move assignment operator, a copy assignment
   //   operator is implicitly declared as defaulted.
   if ((ClassDecl->hasUserDeclaredMoveConstructor() &&
-          !getLangOptions().MicrosoftExt) ||
-      ClassDecl->hasUserDeclaredMoveAssignment() &&
+          !getLangOptions().MicrosoftMode) ||
+      ClassDecl->hasUserDeclaredMoveAssignment() ||
       ShouldDeleteCopyAssignmentOperator(CopyAssignment))
     CopyAssignment->setDeletedAsWritten();
   
@@ -8758,7 +8758,7 @@
   //   declared as defaulted.
   if (ClassDecl->hasUserDeclaredMoveConstructor() ||
       (ClassDecl->hasUserDeclaredMoveAssignment() &&
-          !getLangOptions().MicrosoftExt) ||
+          !getLangOptions().MicrosoftMode) ||
       ShouldDeleteSpecialMember(CopyConstructor, CXXCopyConstructor))
     CopyConstructor->setDeletedAsWritten();
   
diff --git a/test/SemaCXX/MicrosoftCompatibility.cpp b/test/SemaCXX/MicrosoftCompatibility.cpp
index ad11b16..9547a27 100644
--- a/test/SemaCXX/MicrosoftCompatibility.cpp
+++ b/test/SemaCXX/MicrosoftCompatibility.cpp
@@ -68,7 +68,28 @@
   
 }
 
+namespace PR11826 {
+  struct pair {
+    pair(int v) { }
+    void operator=(pair&& rhs) { }
+  };
+  void f() {
+    pair p0(3);
+    pair p = p0;
+  }
+}
 
+namespace PR11826_for_symmetry {
+  struct pair {
+    pair(int v) { }
+    pair(pair&& rhs) { }
+  };
+  void f() {
+    pair p0(3);
+    pair p(4);
+    p = p0;
+  }
+}
 
 namespace ms_using_declaration_bug {

 

diff --git a/test/SemaCXX/microsoft-cxx0x.cpp b/test/SemaCXX/microsoft-cxx0x.cpp
index a0dbb75..3b9bbef 100644
--- a/test/SemaCXX/microsoft-cxx0x.cpp
+++ b/test/SemaCXX/microsoft-cxx0x.cpp
@@ -6,26 +6,3 @@
 };
 int b = 3;
 A var = {  b }; // expected-warning {{ cannot be narrowed }} expected-note {{override}}
-
-namespace PR11826 {
-  struct pair {
-    pair(int v) { }
-    void operator=(pair&& rhs) { }
-  };
-  void f() {
-    pair p0(3);
-    pair p = p0;
-  }
-}
-
-namespace PR11826_for_symmetry {
-  struct pair {
-    pair(int v) { }
-    pair(pair&& rhs) { }
-  };
-  void f() {
-    pair p0(3);
-    pair p(4);
-    p = p0;
-  }
-}