diff options
| author | Hans Wennborg <hans@hanshq.net> | 2015-05-27 00:06:45 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2015-05-27 00:06:45 +0000 |
| commit | 17f9b4469e71544ef62059c7c7d99ee684cb323b (patch) | |
| tree | ae70815af62be0a41bd2ddce91f5dc945f8a957c /clang/test/CodeGenCXX | |
| parent | bc6a90938426330a76ea1ec29d99ca7fcf46f447 (diff) | |
| download | bcm5719-llvm-17f9b4469e71544ef62059c7c7d99ee684cb323b.tar.gz bcm5719-llvm-17f9b4469e71544ef62059c7c7d99ee684cb323b.zip | |
clang-cl: Handle dll attributes in explicit class template specialization definitions (PR23667)
Previously, we wouldn't call checkDLLAttribute() after the class template
specialization definition if the class template was already instantiated
by an explicit class template specialization declaration.
llvm-svn: 238266
Diffstat (limited to 'clang/test/CodeGenCXX')
| -rw-r--r-- | clang/test/CodeGenCXX/dllexport.cpp | 5 | ||||
| -rw-r--r-- | clang/test/CodeGenCXX/dllimport.cpp | 12 |
2 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/dllexport.cpp b/clang/test/CodeGenCXX/dllexport.cpp index bc1486f0d7d..3a1a3ffd871 100644 --- a/clang/test/CodeGenCXX/dllexport.cpp +++ b/clang/test/CodeGenCXX/dllexport.cpp @@ -691,6 +691,11 @@ extern template struct ExplicitInstantiationDeclExportedTemplate<int>; USEMEMFUNC(ExplicitInstantiationDeclExportedTemplate<int>, f); // M32-DAG: {{declare|define available_externally}} x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclExportedTemplate@H@@QAEXXZ" +template <typename T> struct ExplicitInstantiationDeclExportedDefTemplate { void f() {} }; +extern template struct ExplicitInstantiationDeclExportedDefTemplate<int>; +template struct __declspec(dllexport) ExplicitInstantiationDeclExportedDefTemplate<int>; +// M32-DAG: define weak_odr dllexport x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclExportedDefTemplate@H@@QAEXXZ" + namespace { struct InternalLinkageType {}; } struct __declspec(dllexport) PR23308 { void f(InternalLinkageType*); diff --git a/clang/test/CodeGenCXX/dllimport.cpp b/clang/test/CodeGenCXX/dllimport.cpp index 639baea5a3d..6de856017b5 100644 --- a/clang/test/CodeGenCXX/dllimport.cpp +++ b/clang/test/CodeGenCXX/dllimport.cpp @@ -724,6 +724,18 @@ template struct __declspec(dllimport) ExplicitlyInstantiatedWithDifferentAttr<in USEMEMFUNC(ExplicitlyInstantiatedWithDifferentAttr<int>, f); // M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?f@?$ExplicitlyInstantiatedWithDifferentAttr@H@@QAEXXZ" +template <typename T> struct ExplicitInstantiationDeclImportedDefTemplate { void f() {} }; +extern template struct ExplicitInstantiationDeclImportedDefTemplate<int>; +template struct __declspec(dllimport) ExplicitInstantiationDeclImportedDefTemplate<int>; +USEMEMFUNC(ExplicitInstantiationDeclImportedDefTemplate<int>, f); +// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclImportedDefTemplate@H@@QAEXXZ" + +template <typename T> struct __declspec(dllimport) ExplicitInstantiationDeclExportedDefImportedTemplate { void f() {} }; +extern template struct __declspec(dllimport) ExplicitInstantiationDeclExportedDefImportedTemplate <int>; +template struct __declspec(dllexport) ExplicitInstantiationDeclExportedDefImportedTemplate<int>; +USEMEMFUNC(ExplicitInstantiationDeclExportedDefImportedTemplate<int>, f); +// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?f@?$ExplicitInstantiationDeclExportedDefImportedTemplate@H@@QAEXXZ" + //===----------------------------------------------------------------------===// // Classes with template base classes |

