xref: /minix3/external/bsd/llvm/dist/clang/test/Modules/Inputs/cxx-templates-c.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc template<typename> struct MergeSpecializations;
2f4a2713aSLionel Sambuc template<typename T> struct MergeSpecializations<T[]> {
3f4a2713aSLionel Sambuc   typedef int partially_specialized_in_c;
4f4a2713aSLionel Sambuc };
5f4a2713aSLionel Sambuc template<> struct MergeSpecializations<bool> {
6f4a2713aSLionel Sambuc   typedef int explicitly_specialized_in_c;
7f4a2713aSLionel Sambuc };
8*0a6a1f1dSLionel Sambuc 
9*0a6a1f1dSLionel Sambuc template<typename T> struct MergeTemplateDefinitions {
10*0a6a1f1dSLionel Sambuc   static constexpr int f();
11*0a6a1f1dSLionel Sambuc   static constexpr int g();
12*0a6a1f1dSLionel Sambuc };
13*0a6a1f1dSLionel Sambuc template<typename T> constexpr int MergeTemplateDefinitions<T>::g() { return 2; }
14*0a6a1f1dSLionel Sambuc 
15*0a6a1f1dSLionel Sambuc template<typename T1 = int>
16*0a6a1f1dSLionel Sambuc struct MergeAnonUnionMember {
17*0a6a1f1dSLionel Sambuc   MergeAnonUnionMember() { (void)values.t1; }
18*0a6a1f1dSLionel Sambuc   union { int t1; } values;
19*0a6a1f1dSLionel Sambuc };
20*0a6a1f1dSLionel Sambuc inline MergeAnonUnionMember<> maum_c() { return {}; }
21*0a6a1f1dSLionel Sambuc 
22*0a6a1f1dSLionel Sambuc template<typename T> struct DontWalkPreviousDeclAfterMerging { struct Inner { typedef T type; }; };
23*0a6a1f1dSLionel Sambuc typedef DontWalkPreviousDeclAfterMerging<char>::Inner dwpdam_typedef;
24*0a6a1f1dSLionel Sambuc 
25*0a6a1f1dSLionel Sambuc namespace TestInjectedClassName {
26*0a6a1f1dSLionel Sambuc   template<typename T> struct X { X(); };
27*0a6a1f1dSLionel Sambuc   typedef X<char[3]> C;
28*0a6a1f1dSLionel Sambuc }
29