xref: /minix3/external/bsd/llvm/dist/clang/test/Modules/Inputs/templates-right.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1f4a2713aSLionel Sambuc @import templates_top;
2f4a2713aSLionel Sambuc 
3f4a2713aSLionel Sambuc template<typename T> class Vector {
4f4a2713aSLionel Sambuc public:
5f4a2713aSLionel Sambuc   void push_back(const T&);
6f4a2713aSLionel Sambuc };
7f4a2713aSLionel Sambuc 
8f4a2713aSLionel Sambuc template<typename T> class List;
9f4a2713aSLionel Sambuc template<> class List<bool> {
10f4a2713aSLionel Sambuc public:
11f4a2713aSLionel Sambuc   void push_back(int);
12f4a2713aSLionel Sambuc };
13f4a2713aSLionel Sambuc 
14f4a2713aSLionel Sambuc namespace N {
15f4a2713aSLionel Sambuc   template<typename T> class Set {
16f4a2713aSLionel Sambuc   public:
17f4a2713aSLionel Sambuc     void insert(T);
18f4a2713aSLionel Sambuc   };
19f4a2713aSLionel Sambuc }
20f4a2713aSLionel Sambuc 
21f4a2713aSLionel Sambuc constexpr unsigned List<int>::*size_right = &List<int>::size;
22f4a2713aSLionel Sambuc List<int> list_right = { 0, 12 };
23f4a2713aSLionel Sambuc typedef List<int> ListInt_right;
24f4a2713aSLionel Sambuc 
25f4a2713aSLionel Sambuc template <typename T>
pendingInstantiationEmit(T)26f4a2713aSLionel Sambuc void pendingInstantiationEmit(T) {}
triggerPendingInstantiationToo()27f4a2713aSLionel Sambuc void triggerPendingInstantiationToo() {
28f4a2713aSLionel Sambuc   pendingInstantiationEmit(12);
29f4a2713aSLionel Sambuc }
30f4a2713aSLionel Sambuc 
redeclDefinitionEmit()31f4a2713aSLionel Sambuc void redeclDefinitionEmit(){}
32f4a2713aSLionel Sambuc 
33f4a2713aSLionel Sambuc typedef Outer<int>::Inner OuterIntInner_right;
34*0a6a1f1dSLionel Sambuc 
defineListDoubleRight()35*0a6a1f1dSLionel Sambuc int defineListDoubleRight() {
36*0a6a1f1dSLionel Sambuc   List<double> ld;
37*0a6a1f1dSLionel Sambuc   ld.push_back(0.0);
38*0a6a1f1dSLionel Sambuc   return ld.size;
39*0a6a1f1dSLionel Sambuc }
40*0a6a1f1dSLionel Sambuc 
41*0a6a1f1dSLionel Sambuc template<typename T> struct MergePatternDecl;
42*0a6a1f1dSLionel Sambuc 
43*0a6a1f1dSLionel Sambuc void outOfLineInlineUseRightF(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::f);
44*0a6a1f1dSLionel Sambuc void outOfLineInlineUseRightG(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::g);
45*0a6a1f1dSLionel Sambuc void outOfLineInlineUseRightH(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::h);
46*0a6a1f1dSLionel Sambuc 
getStaticDataMemberRight()47*0a6a1f1dSLionel Sambuc inline int *getStaticDataMemberRight() {
48*0a6a1f1dSLionel Sambuc   return WithUndefinedStaticDataMember<int[]>::undefined;
49*0a6a1f1dSLionel Sambuc }
50