diff options
| author | Hans Wennborg <hans@hanshq.net> | 2016-05-25 20:16:43 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2016-05-25 20:16:43 +0000 |
| commit | 12e3bde64ba7686996701489f3b07b3b5ae04cbf (patch) | |
| tree | a138a2eafa51c619725b11a20e0a8bafd82df068 /clang/test/CodeGenCXX/dllexport.cpp | |
| parent | 0a6b95a60adc64999027539bb9f70fab799b8933 (diff) | |
| download | bcm5719-llvm-12e3bde64ba7686996701489f3b07b3b5ae04cbf.tar.gz bcm5719-llvm-12e3bde64ba7686996701489f3b07b3b5ae04cbf.zip | |
clang-cl: Treat dllimport explicit template instantiation definitions as declarations (PR27810, PR27811)
This matches what MSVC does, and should make compiles faster by avoiding to
unnecessarily emit a lot of code.
Differential Revision: http://reviews.llvm.org/D20608
llvm-svn: 270748
Diffstat (limited to 'clang/test/CodeGenCXX/dllexport.cpp')
| -rw-r--r-- | clang/test/CodeGenCXX/dllexport.cpp | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/clang/test/CodeGenCXX/dllexport.cpp b/clang/test/CodeGenCXX/dllexport.cpp index 6232f2c747e..7cef7c2d127 100644 --- a/clang/test/CodeGenCXX/dllexport.cpp +++ b/clang/test/CodeGenCXX/dllexport.cpp @@ -844,6 +844,11 @@ struct __declspec(dllexport) B { // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01??_FB@pr26490@@QAEXXZ" } +// dllexport trumps dllexport on an explicit instantiation. +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" + //===----------------------------------------------------------------------===// // Classes with template base classes @@ -958,14 +963,6 @@ template struct ExplicitInstantiationDeclTemplateBase<int>; // M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ExplicitInstantiationDeclTemplateBase@H@@QAEXXZ" // G32-DAG: define weak_odr x86_thiscallcc void @_ZN37ExplicitInstantiationDeclTemplateBaseIiE4funcEv -template <typename T> struct ExplicitInstantiationDeclTemplateBase2 { void func() {} }; -extern template struct ExplicitInstantiationDeclTemplateBase2<int>; -struct __declspec(dllexport) DerivedFromExplicitInstantiationDeclTemplateBase2 : public ExplicitInstantiationDeclTemplateBase2<int> {}; -template struct __declspec(dllimport) ExplicitInstantiationDeclTemplateBase2<int>; -USEMEMFUNC(ExplicitInstantiationDeclTemplateBase2<int>, func) -// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?func@?$ExplicitInstantiationDeclTemplateBase2@H@@QAEXXZ" -// G32-DAG: define weak_odr x86_thiscallcc void @_ZN38ExplicitInstantiationDeclTemplateBase2IiE4funcEv - // PR26076 struct LayerSelectionBound; template <typename> struct Selection {}; |

