Home | History | Annotate | Download | only in SemaCXX

Lines Matching full:template

1 // RUN: %clang_cc1 -triple i686-win32     -fsyntax-only -fms-extensions -verify -std=c++11 -Wunsupported-dll-base-class-template -DMS %s
2 // RUN: %clang_cc1 -triple x86_64-win32 -fsyntax-only -fms-extensions -verify -std=c++1y -Wunsupported-dll-base-class-template -DMS %s
3 // RUN: %clang_cc1 -triple i686-mingw32 -fsyntax-only -fms-extensions -verify -std=c++1y -Wunsupported-dll-base-class-template %s
4 // RUN: %clang_cc1 -triple x86_64-mingw32 -fsyntax-only -fms-extensions -verify -std=c++11 -Wunsupported-dll-base-class-template %s
95 template<typename T> __declspec(dllexport) extern int ExternVarTmplDecl;
98 template<typename T> __declspec(dllexport) int VarTmplDef;
101 template<typename T> __declspec(dllexport) int VarTmplInit1 = 1;
102 template<typename T> int __declspec(dllexport) VarTmplInit2 = 1;
105 template<typename T> __declspec(dllexport) extern int VarTmplDeclInit;
106 template<typename T> int VarTmplDeclInit = 1;
109 template<typename T> __declspec(dllexport) extern int VarTmplRedecl1;
110 template<typename T> __declspec(dllexport) int VarTmplRedecl1 = 1;
112 template<typename T> __declspec(dllexport) extern int VarTmplRedecl2;
113 template<typename T> int VarTmplRedecl2 = 1;
115 template<typename T> extern int VarTmplRedecl3; // expected-note{{previous declaration is here}}
116 template<typename T> __declspec(dllexport) extern int VarTmplRedecl3; // expected-error{{redeclaration of 'VarTmplRedecl3' cannot add 'dllexport' attribute}}
119 template<typename T> __declspec(dllexport) static int StaticVarTmpl; // expected-error{{'StaticVarTmpl' must have external linkage when declared 'dllexport'}}
120 template<typename T> __declspec(dllexport) Internal InternalTypeVarTmpl; // expected-error{{'InternalTypeVarTmpl' must have external linkage when declared 'dllexport'}}
121 namespace { template<typename T> __declspec(dllexport) int InternalVarTmpl; } // expected-error{{'(anonymous namespace)::InternalVarTmpl' must have external linkage when declared 'dllexport'}}
122 namespace ns { template<typename T> __declspec(dllexport) int ExternalVarTmpl = 1; }
124 template<typename T> __declspec(dllexport) auto InternalAutoTypeVarTmpl = Internal(); // expected-error{{'InternalAutoTypeVarTmpl' must have external linkage when declared 'dllexport'}}
125 template<typename T> __declspec(dllexport) auto ExternalAutoTypeVarTmpl = External();
126 template External ExternalAutoTypeVarTmpl<ExplicitInst_Exported>;
129 template<typename T> int VarTmpl = 1;
130 template<typename T> __declspec(dllexport) int ExportedVarTmpl = 1;
132 // Export implicit instantiation of an exported variable template.
135 // Export explicit instantiation declaration of an exported variable template.
136 extern template int ExportedVarTmpl<ExplicitDecl_Exported>;
137 template int ExportedVarTmpl<ExplicitDecl_Exported>;
139 // Export explicit instantiation definition of an exported variable template.
140 template __declspec(dllexport) int ExportedVarTmpl<ExplicitInst_Exported>;
142 // Export specialization of an exported variable template.
143 template<> __declspec(dllexport) int ExportedVarTmpl<ExplicitSpec_Exported>;
144 template<> __declspec(dllexport) int ExportedVarTmpl<ExplicitSpec_Def_Exported> = 1;
146 // Not exporting specialization of an exported variable template without
148 template<> int ExportedVarTmpl<ExplicitSpec_NotExported>;
151 // Export explicit instantiation declaration of a non-exported variable template.
152 extern template __declspec(dllexport) int VarTmpl<ExplicitDecl_Exported>;
153 template __declspec(dllexport) int VarTmpl<ExplicitDecl_Exported>;
155 // Export explicit instantiation definition of a non-exported variable template.
156 template __declspec(dllexport) int VarTmpl<ExplicitInst_Exported>;
158 // Export specialization of a non-exported variable template.
159 template<> __declspec(dllexport) int VarTmpl<ExplicitSpec_Exported>;
160 template<> __declspec(dllexport) int VarTmpl<ExplicitSpec_Def_Exported> = 1;
242 // Export function template declaration. Check different placements.
243 template<typename T> __declspec(dllexport) void funcTmplDecl1();
244 template<typename T> void __declspec(dllexport) funcTmplDecl2();
246 // Export function template definition.
247 template<typename T> __declspec(dllexport) void funcTmplDef() {}
249 // Export inline function template.
250 template<typename T> __declspec(dllexport) inline void inlineFuncTmpl1() {}
251 template<typename T> inline void __attribute__((dllexport)) inlineFuncTmpl2() {}
253 template<typename T> __declspec(dllexport) inline void inlineFuncTmplDecl();
254 template<typename T> void inlineFuncTmplDecl() {}
256 template<typename T> __declspec(dllexport) void inlineFuncTmplDef();
257 template<typename T> inline void inlineFuncTmplDef() {}
260 template<typename T> __declspec(dllexport) void funcTmplRedecl1();
261 template<typename T> __declspec(dllexport) void funcTmplRedecl1() {}
263 template<typename T> __declspec(dllexport) void funcTmplRedecl2();
264 template<typename T> void funcTmplRedecl2() {}
266 template<typename T> void funcTmplRedecl3(); // expected-note{{previous declaration is here}}
267 template<typename T> __declspec(dllexport) void funcTmplRedecl3(); // expected-error{{redeclaration of 'funcTmplRedecl3' cannot add 'dllexport' attribute}}
269 template<typename T> void funcTmplRedecl4(); // expected-note{{previous declaration is here}}
270 template<typename T> __declspec(dllexport) inline void funcTmplRedecl4() {} // expected-error{{redeclaration of 'funcTmplRedecl4' cannot add 'dllexport' attribute}}
272 // Function template friends
274 template<typename T> friend __declspec(dllexport) void funcTmplFriend1();
275 template<typename T> friend __declspec(dllexport) void funcTmplFriend2();
276 template<typename T> friend void funcTmplFriend3(); // expected-note{{previous declaration is here}}
277 template<typename T> friend void funcTmplFriend4(); // expected-note{{previous declaration is here}}
279 template<typename T> __declspec(dllexport) void funcTmplFriend1() {}
280 template<typename T> void funcTmplFriend2() {}
281 template<typename T> __declspec(dllexport) void funcTmplFriend3() {} // expected-error{{redeclaration of 'funcTmplFriend3' cannot add 'dllexport' attribute}}
282 template<typename T> __declspec(dllexport) inline void funcTmplFriend4() {} // expected-error{{redeclaration of 'funcTmplFriend4' cannot add 'dllexport' attribute}}
285 template<typename T> __declspec(dllexport) static int staticFuncTmpl(); // expected-error{{'staticFuncTmpl' must have external linkage when declared 'dllexport'}}
286 template<typename T> __declspec(dllexport) Internal internalRetFuncTmpl(); // expected-error{{'internalRetFuncTmpl' must have external linkage when declared 'dllexport'}}
287 namespace { template<typename T> __declspec(dllexport) void internalFuncTmpl(); } // expected-error{{'(anonymous namespace)::internalFuncTmpl' must have external linkage when declared 'dllexport'}}
288 namespace ns { template<typename T> __declspec(dllexport) void externalFuncTmpl(); }
291 template<typename T> void funcTmpl() {}
292 template<typename T> __declspec(dllexport) void exportedFuncTmplDecl();
293 template<typename T> __declspec(dllexport) void exportedFuncTmpl() {}
295 // Export implicit instantiation of an exported function template.
299 // Export explicit instantiation declaration of an exported function template.
300 extern template void exportedFuncTmpl<ExplicitDecl_Exported>();
301 template void exportedFuncTmpl<ExplicitDecl_Exported>();
303 // Export explicit instantiation definition of an exported function template.
304 template void exportedFuncTmpl<ExplicitInst_Exported>();
306 // Export specialization of an exported function template.
307 template<> __declspec(dllexport) void exportedFuncTmpl<ExplicitSpec_Exported>();
308 template<> __declspec(dllexport) void exportedFuncTmpl<ExplicitSpec_Def_Exported>() {}
309 template<> __declspec(dllexport) inline void exportedFuncTmpl<ExplicitSpec_InlineDef_Exported>() {}
311 // Not exporting specialization of an exported function template without
313 template<> void exportedFuncTmpl<ExplicitSpec_NotExported>() {}
316 // Export explicit instantiation declaration of a non-exported function template.
317 extern template __declspec(dllexport) void funcTmpl<ExplicitDecl_Exported>();
318 template __declspec(dllexport) void funcTmpl<ExplicitDecl_Exported>();
320 // Export explicit instantiation definition of a non-exported function template.
321 template __declspec(dllexport) void funcTmpl<ExplicitInst_Exported>();
323 // Export specialization of a non-exported function template.
324 template<> __declspec(dllexport) void funcTmpl<ExplicitSpec_Exported>();
325 template<> __declspec(dllexport) void funcTmpl<ExplicitSpec_Def_Exported>() {}
326 template<> __declspec(dllexport) inline void funcTmpl<ExplicitSpec_InlineDef_Exported>() {}
345 template <typename T> struct PartiallySpecializedClassTemplate {};
346 template <typename T> struct __declspec(dllexport) PartiallySpecializedClassTemplate<T*> { void f() {} };
348 template <typename T> struct ExpliciallySpecializedClassTemplate {};
349 template <> struct __declspec(dllexport) ExpliciallySpecializedClassTemplate<int> { void f() {} };
353 template <typename T> struct __declspec(dllexport) ImplicitlyInstantiatedExportedTemplate {
360 template <typename T> struct __declspec(dllexport) ExportedTemplateWithExplicitInstantiationDecl { // expected-note{{attribute is here}}
363 extern template struct ExportedTemplateWithExplicitInstantiationDecl<IncompleteType2>; // expected-warning{{explicit instantiation declaration should not be 'dllexport'}}
367 template <typename T> struct __declspec(dllexport) ExplicitlyInstantiatedExportedTemplate {
370 template struct ExplicitlyInstantiatedExportedTemplate<IncompleteType3>; // expected-note{{in instantiation of member function 'ExplicitlyInstantiatedExportedTemplate<IncompleteType3>::f' requested here}}
378 template <typename T> struct BaseClassTemplateOfExportedClass {
388 template <typename T> struct __declspec(dllexport) ExportedBaseClassTemplateOfExportedClass {
394 template <typename T> struct ExplicitInstantiationDeclTemplate {};
395 extern template struct __declspec(dllexport) ExplicitInstantiationDeclTemplate<int>; // expected-warning{{explicit instantiation declaration should not be 'dllexport'}} expected-note{{attribute is here}}
397 template <typename T> struct __declspec(dllexport) ExplicitInstantiationDeclExportedTemplate {}; // expected-note{{attribute is here}}
398 extern template struct ExplicitInstantiationDeclExportedTemplate<int>; // expected-warning{{explicit instantiation declaration should not be 'dllexport'}}
407 // Classes with template base classes
410 template <typename T> class ClassTemplate {};
411 template <typename T> class __declspec(dllexport) ExportedClassTemplate {};
412 template <typename T> class __declspec(dllimport) ImportedClassTemplate {};
414 template <typename T> struct ExplicitlySpecializedTemplate { void func() {} };
416 // expected-note@+2{{class template 'ExplicitlySpecializedTemplate<int>' was explicitly specialized here}}
418 template <> struct ExplicitlySpecializedTemplate<int> { void func() {} };
419 template <typename T> struct ExplicitlyExportSpecializedTemplate { void func() {} };
420 template <> struct __declspec(dllexport) ExplicitlyExportSpecializedTemplate<int> { void func() {} };
421 template <typename T> struct ExplicitlyImportSpecializedTemplate { void func() {} };
422 template <> struct __declspec(dllimport) ExplicitlyImportSpecializedTemplate<int> { void func() {} };
424 template <typename T> struct ExplicitlyInstantiatedTemplate { void func() {} };
426 // expected-note@+2{{class template 'ExplicitlyInstantiatedTemplate<int>' was instantiated here}}
428 template struct ExplicitlyInstantiatedTemplate<int>;
429 template <typename T> struct ExplicitlyExportInstantiatedTemplate { void func() {} };
430 template struct __declspec(dllexport) ExplicitlyExportInstantiatedTemplate<int>;
431 template <typename T> struct ExplicitlyImportInstantiatedTemplate { void func() {} };
432 template struct __declspec(dllimport) ExplicitlyImportInstantiatedTemplate<int>;
451 extern template class ClassTemplate<float>;
459 // expected-warning@+3{{propagating dll attribute to explicitly specialized base class template without dll attribute is not supported}}
471 // expected-warning@+3{{propagating dll attribute to already instantiated base class template without dll attribute is not supported}}
482 template <typename T> struct ExplicitInstantiationDeclTemplateBase { void func() {} };
483 extern template struct ExplicitInstantiationDeclTemplateBase<int>;
740 template<typename T> __declspec(dllexport) void normalDecl();
741 template<typename T> __declspec(dllexport) void normalDef();
742 template<typename T> __declspec(dllexport) void normalInclass() {}
743 template<typename T> __declspec(dllexport) void normalInlineDef();
744 template<typename T> __declspec(dllexport) inline void normalInlineDecl();
745 template<typename T> __declspec(dllexport) static void staticDecl();
746 template<typename T> __declspec(dllexport) static void staticDef();
747 template<typename T> __declspec(dllexport) static void staticInclass() {}
748 template<typename T> __declspec(dllexport) static void staticInlineDef();
749 template<typename T> __declspec(dllexport) static inline void staticInlineDecl();
752 template<typename T> __declspec(dllexport) static int StaticField;
753 template<typename T> __declspec(dllexport) static int StaticFieldDef;
754 template<typename T> __declspec(dllexport) static const int StaticConstField;
755 template<typename T> __declspec(dllexport) static const int StaticConstFieldDef;
756 template<typename T> __declspec(dllexport) static const int StaticConstFieldEqualInit = 1;
757 template<typename T> __declspec(dllexport) static const int StaticConstFieldBraceInit{1};
758 template<typename T> __declspec(dllexport) constexpr static int ConstexprField = 1;
759 template<typename T> __declspec(dllexport) constexpr static int ConstexprFieldDef = 1;
763 template<typename T> void ExportMemberTmpl::normalDef() {}
764 template<typename T> inline void ExportMemberTmpl::normalInlineDef() {}
765 template<typename T> void ExportMemberTmpl::normalInlineDecl() {}
766 template<typename T> void ExportMemberTmpl::staticDef() {}
767 template<typename T> inline void ExportMemberTmpl::staticInlineDef() {}
768 template<typename T> void ExportMemberTmpl::staticInlineDecl() {}
771 template<typename T> int ExportMemberTmpl::StaticFieldDef;
772 template<typename T> const int ExportMemberTmpl::StaticConstFieldDef = 1;
773 template<typename T> constexpr int ExportMemberTmpl::ConstexprFieldDef;
779 template<typename T> void normalDef(); // expected-note{{previous declaration is here}}
780 template<typename T> void normalInlineDef(); // expected-note{{previous declaration is here}}
781 template<typename T> inline void normalInlineDecl(); // expected-note{{previous declaration is here}}
782 template<typename T> static void staticDef(); // expected-note{{previous declaration is here}}
783 template<typename T> static void staticInlineDef(); // expected-note{{previous declaration is here}}
784 template<typename T> static inline void staticInlineDecl(); // expected-note{{previous declaration is here}}
787 template<typename T> static int StaticField; // expected-note{{previous declaration is here}}
788 template<typename T> static const int StaticConstField; // expected-note{{previous declaration is here}}
789 template<typename T> constexpr static int ConstexprField = 1; // expected-note{{previous declaration is here}}
793 template<typename T> __declspec(dllexport) void MemTmplRedecl::normalDef() {} // expected-error{{redeclaration of 'MemTmplRedecl::normalDef' cannot add 'dllexport' attribute}}
794 template<typename T> __declspec(dllexport) inline void MemTmplRedecl::normalInlineDef() {} // expected-error{{redeclaration of 'MemTmplRedecl::normalInlineDef' cannot add 'dllexport' attribute}}
795 template<typename T> __declspec(dllexport) void MemTmplRedecl::normalInlineDecl() {} // expected-error{{redeclaration of 'MemTmplRedecl::normalInlineDecl' cannot add 'dllexport' attribute}}
796 template<typename T> __declspec(dllexport) void MemTmplRedecl::staticDef() {} // expected-error{{redeclaration of 'MemTmplRedecl::staticDef' cannot add 'dllexport' attribute}}
797 template<typename T> __declspec(dllexport) inline void MemTmplRedecl::staticInlineDef() {} // expected-error{{redeclaration of 'MemTmplRedecl::staticInlineDef' cannot add 'dllexport' attribute}}
798 template<typename T> __declspec(dllexport) void MemTmplRedecl::staticInlineDecl() {} // expected-error{{redeclaration of 'MemTmplRedecl::staticInlineDecl' cannot add 'dllexport' attribute}}
801 template<typename T> __declspec(dllexport) int MemTmplRedecl::StaticField = 1; // expected-error{{redeclaration of 'MemTmplRedecl::StaticField' cannot add 'dllexport' attribute}}
802 template<typename T> __declspec(dllexport) const int MemTmplRedecl::StaticConstField = 1; // expected-error{{redeclaration of 'MemTmplRedecl::StaticConstField' cannot add 'dllexport' attribute}}
803 template<typename T> __declspec(dllexport) constexpr int MemTmplRedecl::ConstexprField; // expected-error{{redeclaration of 'MemTmplRedecl::ConstexprField' cannot add 'dllexport' attribute}}
809 template<typename T> void normalDef() {}
810 template<typename T> __declspec(dllexport) void exportedNormal() {}
811 template<typename T> static void staticDef() {}
812 template<typename T> __declspec(dllexport) static void exportedStatic() {}
815 // Export implicit instantiation of an exported member function template.
822 // template.
823 extern template void MemFunTmpl::exportedNormal<ExplicitDecl_Exported>();
824 template void MemFunTmpl::exportedNormal<ExplicitDecl_Exported>();
826 extern template void MemFunTmpl::exportedStatic<ExplicitDecl_Exported>();
827 template void MemFunTmpl::exportedStatic<ExplicitDecl_Exported>();
830 // template.
831 template void MemFunTmpl::exportedNormal<ExplicitInst_Exported>();
832 template void MemFunTmpl::exportedStatic<ExplicitInst_Exported>();
834 // Export specialization of an exported member function template.
835 template<> __declspec(dllexport) void MemFunTmpl::exportedNormal<ExplicitSpec_Exported>();
836 template<> __declspec(dllexport) void MemFunTmpl::exportedNormal<ExplicitSpec_Def_Exported>() {}
837 template<> __declspec(dllexport) inline void MemFunTmpl::exportedNormal<ExplicitSpec_InlineDef_Exported>() {}
839 template<> __declspec(dllexport) void MemFunTmpl::exportedStatic<ExplicitSpec_Exported>();
840 template<> __declspec(dllexport) void MemFunTmpl::exportedStatic<ExplicitSpec_Def_Exported>() {}
841 template<> __declspec(dllexport) inline void MemFunTmpl::exportedStatic<ExplicitSpec_InlineDef_Exported>() {}
843 // Not exporting specialization of an exported member function template without
845 template<> void MemFunTmpl::exportedNormal<ExplicitSpec_NotExported>() {}
846 template<> void MemFunTmpl::exportedStatic<ExplicitSpec_NotExported>() {}
850 // template.
851 extern template __declspec(dllexport) void MemFunTmpl::normalDef<ExplicitDecl_Exported>();
852 template __declspec(dllexport) void MemFunTmpl::normalDef<ExplicitDecl_Exported>();
854 extern template __declspec(dllexport) void MemFunTmpl::staticDef<ExplicitDecl_Exported>();
855 template __declspec(dllexport) void MemFunTmpl::staticDef<ExplicitDecl_Exported>();
858 // template.
859 template __declspec(dllexport) void MemFunTmpl::normalDef<ExplicitInst_Exported>();
860 template __declspec(dllexport) void MemFunTmpl::staticDef<ExplicitInst_Exported>();
862 // Export specialization of a non-exported member function template.
863 template<> __declspec(dllexport) void MemFunTmpl::normalDef<ExplicitSpec_Exported>();
864 template<> __declspec(dllexport) void MemFunTmpl::normalDef<ExplicitSpec_Def_Exported>() {}
865 template
867 template<> __declspec(dllexport) void MemFunTmpl::staticDef<ExplicitSpec_Exported>();
868 template<> __declspec(dllexport) void MemFunTmpl::staticDef<ExplicitSpec_Def_Exported>() {}
869 template<> __declspec(dllexport) inline void MemFunTmpl::staticDef<ExplicitSpec_InlineDef_Exported>() {}
875 template<typename T> static const int StaticVar = 1;
876 template<typename T> __declspec(dllexport) static const int ExportedStaticVar = 1;
878 template<typename T> const int MemVarTmpl::StaticVar;
879 template<typename T> const int MemVarTmpl::ExportedStaticVar;
881 // Export implicit instantiation of an exported member variable template.
885 // template.
886 extern template const int MemVarTmpl::ExportedStaticVar<ExplicitDecl_Exported>;
887 template const int MemVarTmpl::ExportedStaticVar<ExplicitDecl_Exported>;
890 // template.
891 template const int MemVarTmpl::ExportedStaticVar<ExplicitInst_Exported>;
893 // Export specialization of an exported member variable template.
894 template<> __declspec(dllexport) const int MemVarTmpl::ExportedStaticVar<ExplicitSpec_Exported>;
895 template<> __declspec(dllexport) const int MemVarTmpl::ExportedStaticVar<ExplicitSpec_Def_Exported> = 1;
897 // Not exporting specialization of an exported member variable template without
899 template<> const int MemVarTmpl::ExportedStaticVar<ExplicitSpec_NotExported>;
903 // template.
904 extern template __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitDecl_Exported>;
905 template __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitDecl_Exported>;
908 // template.
909 template __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitInst_Exported>;
911 // Export specialization of a non-exported member variable template.
912 template<> __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitSpec_Exported>;
913 template<> __declspec(dllexport) const int MemVarTmpl::StaticVar<ExplicitSpec_Def_Exported> = 1;
920 // Class template members
923 // Export individual members of a class template.
924 template<typename T>
959 template<typename T> void ExportClassTmplMembers<T>::normalDef() {}
960 template<typename T> inline void ExportClassTmplMembers<T>::normalInlineDef() {}
961 template<typename T> void ExportClassTmplMembers<T>::normalInlineDecl() {}
962 template<typename T> void ExportClassTmplMembers<T>::virtualDef() {}
963 template<typename T> inline void ExportClassTmplMembers<T>::virtualInlineDef() {}
964 template<typename T> void ExportClassTmplMembers<T>::virtualInlineDecl() {}
965 template<typename T> void ExportClassTmplMembers<T>::staticDef() {}
966 template<typename T> inline void ExportClassTmplMembers<T>::staticInlineDef() {}
967 template<typename T> void ExportClassTmplMembers<T>::staticInlineDecl() {}
968 template<typename T> void ExportClassTmplMembers<T>::protectedDef() {}
969 template<typename T> void ExportClassTmplMembers<T>::privateDef() {}
971 template<typename T> int ExportClassTmplMembers<T>::StaticFieldDef;
972 template<typename T> const int ExportClassTmplMembers<T>::StaticConstFieldDef = 1;
973 template<typename T> constexpr int ExportClassTmplMembers<T>::ConstexprFieldDef;
975 template struct ExportClassTmplMembers<ImplicitInst_Exported>;
979 template<typename T>
996 template<typename T> __declspec(dllexport) void CTMR<T>::normalDef() {} // expected-error{{redeclaration of 'CTMR::normalDef' cannot add 'dllexport' attribute}}
997 template<typename T> __declspec(dllexport) inline void CTMR<T>::normalInlineDef() {} // expected-error{{redeclaration of 'CTMR::normalInlineDef' cannot add 'dllexport' attribute}}
998 template<typename T> __declspec(dllexport) void CTMR<T>::normalInlineDecl() {} // expected-error{{redeclaration of 'CTMR::normalInlineDecl' cannot add 'dllexport' attribute}}
999 template<typename T> __declspec(dllexport) void CTMR<T>::virtualDef() {} // expected-error{{redeclaration of 'CTMR::virtualDef' cannot add 'dllexport' attribute}}
1000 template<typename T> __declspec(dllexport) inline void CTMR<T>::virtualInlineDef() {} // expected-error{{redeclaration of 'CTMR::virtualInlineDef' cannot add 'dllexport' attribute}}
1001 template<typename T> __declspec(dllexport) void CTMR<T>::virtualInlineDecl() {} // expected-error{{redeclaration of 'CTMR::virtualInlineDecl' cannot add 'dllexport' attribute}}
1002 template<typename T> __declspec(dllexport) void CTMR<T>::staticDef() {} // expected-error{{redeclaration of 'CTMR::staticDef' cannot add 'dllexport' attribute}}
1003 template<typename T> __declspec(dllexport) inline void CTMR<T>::staticInlineDef() {} // expected-error{{redeclaration of 'CTMR::staticInlineDef' cannot add 'dllexport' attribute}}
1004 template<typename T> __declspec(dllexport) void CTMR<T>::staticInlineDecl() {} // expected-error{{redeclaration of 'CTMR::staticInlineDecl' cannot add 'dllexport' attribute}}
1006 template<typename T> __declspec(dllexport) int CTMR<T>::StaticField = 1; // expected-error{{redeclaration of 'CTMR::StaticField' cannot add 'dllexport' attribute}}
1007 template<typename T> __declspec(dllexport) const int CTMR<T>::StaticConstField = 1; // expected-error{{redeclaration of 'CTMR::StaticConstField' cannot add 'dllexport' attribute}}
1008 template<typename T> __declspec(dllexport) constexpr int CTMR<T>::ConstexprField; // expected-error{{redeclaration of 'CTMR::ConstexprField' cannot add 'dllexport' attribute}}
1013 // Class template member templates
1016 template<typename T>
1018 template<typename U> __declspec(dllexport) void normalDecl();
1019 template<typename U> __declspec(dllexport) void normalDef();
1020 template<typename U> __declspec(dllexport) void normalInclass() {}
1021 template<typename U> __declspec(dllexport) void normalInlineDef();
1022 template<typename U> __declspec(dllexport) inline void normalInlineDecl();
1023 template<typename U> __declspec(dllexport) static void staticDecl();
1024 template<typename U> __declspec(dllexport) static void staticDef();
1025 template<typename U> __declspec(dllexport) static void staticInclass() {}
1026 template<typename U> __declspec(dllexport) static void staticInlineDef();
1027 template<typename U> __declspec(dllexport) static inline void staticInlineDecl();
1030 template<typename U> __declspec(dllexport) static int StaticField;
1031 template<typename U> __declspec(dllexport) static int StaticFieldDef;
1032 template<typename U> __declspec(dllexport) static const int StaticConstField;
1033 template<typename U> __declspec(dllexport) static const int StaticConstFieldDef;
1034 template<typename U> __declspec(dllexport) static const int StaticConstFieldEqualInit = 1;
1035 template<typename U> __declspec(dllexport) static const int StaticConstFieldBraceInit{1};
1036 template<typename U> __declspec(dllexport) constexpr static int ConstexprField = 1;
1037 template<typename U> __declspec(dllexport) constexpr static int ConstexprFieldDef = 1;
1041 template<typename T> template<typename U> void ExportClsTmplMemTmpl<T>::normalDef() {}
1042 template<typename T> template<typename U> inline void ExportClsTmplMemTmpl<T>::normalInlineDef() {}
1043 template<typename T> template<typename U> void ExportClsTmplMemTmpl<T>::normalInlineDecl() {}
1044 template<typename T> template<typename U> void ExportClsTmplMemTmpl<T>::staticDef() {}
1045 template<typename T> template<typename U> inline void ExportClsTmplMemTmpl<T>::staticInlineDef() {}
1046 template<typename T> template<typename U> void ExportClsTmplMemTmpl<T>::staticInlineDecl() {}
1049 template<typename T> template<typename U> int ExportClsTmplMemTmpl<T>::StaticFieldDef;
1050 template<typename T> template<typename U> const int ExportClsTmplMemTmpl<T>::StaticConstFieldDef = 1;
1051 template<typename T> template<typename U> constexpr int ExportClsTmplMemTmpl<T>::ConstexprFieldDef;
1056 template<typename T>
1058 template<typename U> void normalDef(); // expected-note{{previous declaration is here}}
1059 template<typename U> void normalInlineDef(); // expected-note{{previous declaration is here}}
1060 template<typename U> inline void normalInlineDecl(); // expected-note{{previous declaration is here}}
1061 template<typename U> static void staticDef(); // expected-note{{previous declaration is here}}
1062 template<typename U> static void staticInlineDef(); // expected-note{{previous declaration is here}}
1063 template<typename U> static inline void staticInlineDecl(); // expected-note{{previous declaration is here}}
1066 template<typename U> static int StaticField; // expected-note{{previous declaration is here}}
1067 template<typename U> static const int StaticConstField; // expected-note{{previous declaration is here}}
1068 template<typename U> constexpr static int ConstexprField = 1; // expected-note{{previous declaration is here}}
1072 template<typename T> template<typename U> __declspec(dllexport) void CTMTR<T>::normalDef() {} // expected-error{{redeclaration of 'CTMTR::normalDef' cannot add 'dllexport' attribute}}
1073 template<typename T> template<typename U> __declspec(dllexport) inline void CTMTR<T>::normalInlineDef() {} // expected-error{{redeclaration of 'CTMTR::normalInlineDef' cannot add 'dllexport' attribute}}
1074 template<typename T> template<typename U> __declspec(dllexport) void CTMTR<T>::normalInlineDecl() {} // expected-error{{redeclaration of 'CTMTR::normalInlineDecl' cannot add 'dllexport' attribute}}
1075 template<typename T> template<typename U> __declspec(dllexport) void CTMTR<T>::staticDef() {} // expected-error{{redeclaration of 'CTMTR::staticDef' cannot add 'dllexport' attribute}}
1076 template<typename T> template<typename U> __declspec(dllexport) inline void CTMTR<T>::staticInlineDef() {} // expected-error{{redeclaration of 'CTMTR::staticInlineDef' cannot add 'dllexport' attribute}}
1077 template<typename T> template<typename U> __declspec(dllexport) void CTMTR<T>::staticInlineDecl() {} // expected-error{{redeclaration of 'CTMTR::staticInlineDecl' cannot add 'dllexport' attribute}}
1080 template<typename T> template<typename U> __declspec(dllexport) int CTMTR<T>::StaticField = 1; // expected-error{{redeclaration of 'CTMTR::StaticField' cannot add 'dllexport' attribute}}
1081 template<typename T> template<typename U> __declspec(dllexport) const int CTMTR<T>::StaticConstField = 1; // expected-error{{redeclaration of 'CTMTR::StaticConstField' cannot add 'dllexport' attribute}}
1082 template<typename T> template<typename U> __declspec(dllexport) constexpr int CTMTR<T>::ConstexprField; // expected-error{{redeclaration of 'CTMTR::ConstexprField' cannot add 'dllexport' attribute}}