]> granicus.if.org Git - clang/commitdiff
Revert "For dllexport class templates, export specializations of member functions...
authorReid Kleckner <rnk@google.com>
Fri, 6 Oct 2017 21:28:21 +0000 (21:28 +0000)
committerReid Kleckner <rnk@google.com>
Fri, 6 Oct 2017 21:28:21 +0000 (21:28 +0000)
This reverts r315025, it caused http://crbug.com/772461

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@315111 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDecl.cpp
test/CodeGenCXX/dllexport.cpp

index 5b90557e79976260b2fe8f5c81e3a6f642433e54..48fb2318e6125d993de1a4f5df24b7bb7b1170be 100644 (file)
@@ -6041,21 +6041,6 @@ static void checkDLLAttributeRedeclaration(Sema &S, NamedDecl *OldDecl,
            diag::warn_dllimport_dropped_from_inline_function)
         << NewDecl << OldImportAttr;
   }
-
-  // A specialization of a class template member function is processed here
-  // since it's a redeclaration. If the parent class is dllexport, the
-  // specialization inherits that attribute. This doesn't happen automatically
-  // since the parent class isn't instantiated until later.
-  if (IsSpecialization && isa<CXXMethodDecl>(NewDecl) && !NewImportAttr &&
-      !NewExportAttr) {
-    if (const DLLExportAttr *ParentExportAttr = cast<CXXMethodDecl>(NewDecl)
-                                             ->getParent()
-                                             ->getAttr<DLLExportAttr>()) {
-      DLLExportAttr *NewAttr = ParentExportAttr->clone(S.Context);
-      NewAttr->setInherited(true);
-      NewDecl->addAttr(NewAttr);
-    }
-  }
 }
 
 /// Given that we are within the definition of the given function,
index a984b6d7ef1c5650c42a18c882f0d1d8d777abb4..bdef2eb06e69a18b0b371308e1859c9e5876d043 100644 (file)
@@ -831,14 +831,6 @@ template <typename T> struct ExplicitInstantiationTwoAttributes { void f() {} };
 template struct __declspec(dllexport) __declspec(dllimport) ExplicitInstantiationTwoAttributes<int>;
 // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ExplicitInstantiationTwoAttributes@H@@QAEXXZ"
 
-// Specializations of exported class template functions get exported.
-namespace pr34849 {
-template <typename T> struct __declspec(dllexport) ExportedClass { void foo(); };
-template<> void ExportedClass<int>::foo() {}
-template struct ExportedClass<int>;
-// M32-DAG: define dllexport x86_thiscallcc void @"\01?foo@?$ExportedClass@H@pr34849@@QAEXXZ"
-}
-
 
 //===----------------------------------------------------------------------===//
 // Classes with template base classes