[PATCH] D20422: [MSVC2015] dllexport for defaulted special class members

Dmitry Polukhin via cfe-commits cfe-commits at lists.llvm.org
Mon May 23 06:36:59 PDT 2016


DmitryPolukhin added a comment.

PTAL


================
Comment at: lib/Sema/SemaDeclCXX.cpp:13113-13114
@@ -13065,28 +13112,4 @@
 
-    if (MD->isInvalidDecl())
-      return;
-
-    switch (Member) {
-    case CXXDefaultConstructor:
-      DefineImplicitDefaultConstructor(DefaultLoc,
-                                       cast<CXXConstructorDecl>(MD));
-      break;
-    case CXXCopyConstructor:
-      DefineImplicitCopyConstructor(DefaultLoc, cast<CXXConstructorDecl>(MD));
-      break;
-    case CXXCopyAssignment:
-      DefineImplicitCopyAssignment(DefaultLoc, MD);
-      break;
-    case CXXDestructor:
-      DefineImplicitDestructor(DefaultLoc, cast<CXXDestructorDecl>(MD));
-      break;
-    case CXXMoveConstructor:
-      DefineImplicitMoveConstructor(DefaultLoc, cast<CXXConstructorDecl>(MD));
-      break;
-    case CXXMoveAssignment:
-      DefineImplicitMoveAssignment(DefaultLoc, MD);
-      break;
-    case CXXInvalid:
-      llvm_unreachable("Invalid special member.");
-    }
+    if (!MD->isInvalidDecl())
+      DefineImplicitSpecialMember(*this, MD, DefaultLoc);
   } else {
----------------
I added code to drop dllexport attribute but the check for dropping dllexport attribute is basically the same. Moreover it cannot be done when the attribute is processed because we need full class definition so I moved the check to CheckCompletedCXXClass. Alternatively I can move the check to checkClassLevelDLLAttribute but it will start working for classes without class level dllexport attribute to detect if any class member has member level attribute (it is less efficient  because it requires more more loop over all class methods even for all classes).


http://reviews.llvm.org/D20422





More information about the cfe-commits mailing list