summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/dllimport.cpp
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-11-29 23:44:11 +0000
committerHans Wennborg <hans@hanshq.net>2017-11-29 23:44:11 +0000
commit2848f56185c915bdd8c3c826b4fb26a47b5a802d (patch)
tree42baa17686ac1d2518f441a6c099cab9a9a3ec2c /test/CodeGenCXX/dllimport.cpp
parent1da00dddf41ad232a224d2781b97cac13792bb1a (diff)
MS ABI: Treat explicit instantiation definitions of dllimport function templates as explicit instantiation decls (PR35435)
This matches MSVC's behaviour, and we already do it for class templates since r270897. Differential revision: https://reviews.llvm.org/D40621 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319386 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/dllimport.cpp')
-rw-r--r--test/CodeGenCXX/dllimport.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/test/CodeGenCXX/dllimport.cpp b/test/CodeGenCXX/dllimport.cpp
index 372a96ba2e..14558aec39 100644
--- a/test/CodeGenCXX/dllimport.cpp
+++ b/test/CodeGenCXX/dllimport.cpp
@@ -579,7 +579,7 @@ USE(inlineFuncTmpl<ExplicitDecl_Imported>)
// MSC-DAG: declare dllimport void @"\01??$inlineFuncTmpl@UExplicitInst_Imported@@@@YAXXZ"()
// GNU-DAG: declare dllimport void @_Z8funcTmplI21ExplicitInst_ImportedEvv()
// GNU-DAG: define weak_odr void @_Z14inlineFuncTmplI21ExplicitInst_ImportedEvv()
-// MO1-DAG: define available_externally dllimport void @"\01??$funcTmpl@UExplicitInst_Imported@@@@YAXXZ"()
+// MO1-DAG: declare dllimport void @"\01??$funcTmpl@UExplicitInst_Imported@@@@YAXXZ"()
// MO1-DAG: define available_externally dllimport void @"\01??$inlineFuncTmpl@UExplicitInst_Imported@@@@YAXXZ"()
// GO1-DAG: define available_externally dllimport void @_Z8funcTmplI21ExplicitInst_ImportedEvv()
// GO1-DAG: define weak_odr void @_Z14inlineFuncTmplI21ExplicitInst_ImportedEvv()
@@ -609,6 +609,15 @@ USE(funcTmpl<ExplicitSpec_Imported>)
template<> __declspec(dllimport) inline void funcTmpl<ExplicitSpec_InlineDef_Imported>() {}
USE(funcTmpl<ExplicitSpec_InlineDef_Imported>)
+#ifdef MSABI
+namespace pr35435 {
+struct X;
+template <typename T> struct __declspec(dllimport) S {
+ void foo(T *t) { t->problem(); }
+};
+template void S<X>::foo(X*); // Cannot be instantiated because X is incomplete; dllimport means it's treated as an instantiation decl.
+}
+#endif
//===----------------------------------------------------------------------===//