diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-08-23 22:34:43 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-08-23 22:34:43 +0000 |
commit | 5148a692554b5680815a40fa8c03a2a62689b3de (patch) | |
tree | 3dc5e0914c960ad7648b17658a324c3a991191a4 /test/CodeGenCXX/dllimport.cpp | |
parent | 9c6a47786ab965a9a1819aa4d7d53227246bb337 (diff) |
MS ABI: Inherit DLL attributes to partial class template specializations
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@216333 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/dllimport.cpp')
-rw-r--r-- | test/CodeGenCXX/dllimport.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGenCXX/dllimport.cpp b/test/CodeGenCXX/dllimport.cpp index c0949942dc..3292a9fa38 100644 --- a/test/CodeGenCXX/dllimport.cpp +++ b/test/CodeGenCXX/dllimport.cpp @@ -679,12 +679,21 @@ USEMEMFUNC(PartiallySpecializedClassTemplate<void*>, f); // M32-DAG: define linkonce_odr x86_thiscallcc void @"\01?f@?$PartiallySpecializedClassTemplate@PAX@@QAEXXZ" // G32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @_ZN33PartiallySpecializedClassTemplateIPvE1fEv +// Attributes on explicit specializations are honored. template <typename T> struct ExplicitlySpecializedClassTemplate {}; template <> struct __declspec(dllimport) ExplicitlySpecializedClassTemplate<void*> { void f() {} }; USEMEMFUNC(ExplicitlySpecializedClassTemplate<void*>, f); // M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?f@?$ExplicitlySpecializedClassTemplate@PAX@@QAEXXZ" // G32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @_ZN34ExplicitlySpecializedClassTemplateIPvE1fEv +// MS inherits DLL attributes to partial specializations. +template <typename T> struct __declspec(dllimport) PartiallySpecializedImportedClassTemplate {}; +template <typename T> struct PartiallySpecializedImportedClassTemplate<T*> { void f() {} }; +USEMEMFUNC(PartiallySpecializedImportedClassTemplate<void*>, f); +// M32-DAG: {{declare|define available_externally}} dllimport x86_thiscallcc void @"\01?f@?$PartiallySpecializedImportedClassTemplate@PAX@@QAEXXZ" +// G32-DAG: define linkonce_odr x86_thiscallcc void @_ZN41PartiallySpecializedImportedClassTemplateIPvE1fEv + + //===----------------------------------------------------------------------===// // Classes with template base classes //===----------------------------------------------------------------------===// |