forked from OSchip/llvm-project
Revert "For dllexport class templates, export specializations of member functions (PR34849)"
This reverts r315025, it caused http://crbug.com/772461 llvm-svn: 315111
This commit is contained in:
parent
07bc04ff38
commit
ebaf772204
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue