[cfe-commits] r148677 - in /cfe/trunk: lib/Sema/SemaDeclCXX.cpp test/SemaCXX/MicrosoftCompatibility.cpp test/SemaCXX/microsoft-cxx0x.cpp

Nico Weber nicolasweber at gmx.de
Sun Jan 22 20:01:33 PST 2012


Author: nico
Date: Sun Jan 22 22:01:33 2012
New Revision: 148677

URL: http://llvm.org/viewvc/llvm-project?rev=148677&view=rev
Log:
Eli says this should check MicrosoftMode instead.

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


Modified:
    cfe/trunk/lib/Sema/SemaDeclCXX.cpp
    cfe/trunk/test/SemaCXX/MicrosoftCompatibility.cpp
    cfe/trunk/test/SemaCXX/microsoft-cxx0x.cpp

Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=148677&r1=148676&r2=148677&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Sun Jan 22 22:01:33 2012
@@ -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();
   

Modified: cfe/trunk/test/SemaCXX/MicrosoftCompatibility.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/MicrosoftCompatibility.cpp?rev=148677&r1=148676&r2=148677&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/MicrosoftCompatibility.cpp (original)
+++ cfe/trunk/test/SemaCXX/MicrosoftCompatibility.cpp Sun Jan 22 22:01:33 2012
@@ -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 {
 

Modified: cfe/trunk/test/SemaCXX/microsoft-cxx0x.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaCXX/microsoft-cxx0x.cpp?rev=148677&r1=148676&r2=148677&view=diff
==============================================================================
--- cfe/trunk/test/SemaCXX/microsoft-cxx0x.cpp (original)
+++ cfe/trunk/test/SemaCXX/microsoft-cxx0x.cpp Sun Jan 22 22:01:33 2012
@@ -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;
-  }
-}





More information about the cfe-commits mailing list