1f4a2713aSLionel Sambuc @import templates_top; 2f4a2713aSLionel Sambuc 3f4a2713aSLionel Sambuc template<typename T> class Vector; 4f4a2713aSLionel Sambuc 5f4a2713aSLionel Sambuc template<typename T> class Vector; 6f4a2713aSLionel Sambuc 7f4a2713aSLionel Sambuc template<typename T> class List; 8f4a2713aSLionel Sambuc template<> class List<bool> { 9f4a2713aSLionel Sambuc public: 10f4a2713aSLionel Sambuc void push_back(int); 11f4a2713aSLionel Sambuc }; 12f4a2713aSLionel Sambuc namespace N { 13f4a2713aSLionel Sambuc template<typename T> class Set; 14f4a2713aSLionel Sambuc } 15f4a2713aSLionel Sambuc namespace N { 16f4a2713aSLionel Sambuc template<typename T> class Set { 17f4a2713aSLionel Sambuc public: 18f4a2713aSLionel Sambuc void insert(T); 19f4a2713aSLionel Sambuc }; 20f4a2713aSLionel Sambuc } 21f4a2713aSLionel Sambuc 22f4a2713aSLionel Sambuc constexpr unsigned List<int>::*size_left = &List<int>::size; 23f4a2713aSLionel Sambuc List<int> list_left = { 0, 8 }; 24f4a2713aSLionel Sambuc typedef List<int> ListInt_left; 25f4a2713aSLionel Sambuc 26f4a2713aSLionel Sambuc template <typename T> pendingInstantiationEmit(T)27f4a2713aSLionel Sambucvoid pendingInstantiationEmit(T) {} triggerPendingInstantiation()28f4a2713aSLionel Sambucvoid triggerPendingInstantiation() { 29f4a2713aSLionel Sambuc pendingInstantiationEmit(12); 30f4a2713aSLionel Sambuc pendingInstantiationEmit(42.); 31f4a2713aSLionel Sambuc } 32f4a2713aSLionel Sambuc redeclDefinitionEmit()33f4a2713aSLionel Sambucvoid redeclDefinitionEmit(){} 34f4a2713aSLionel Sambuc 35f4a2713aSLionel Sambuc typedef Outer<int>::Inner OuterIntInner_left; 36*0a6a1f1dSLionel Sambuc defineListDoubleLeft()37*0a6a1f1dSLionel Sambucint defineListDoubleLeft() { 38*0a6a1f1dSLionel Sambuc List<double> ld; 39*0a6a1f1dSLionel Sambuc ld.push_back(0.0); 40*0a6a1f1dSLionel Sambuc return ld.size; 41*0a6a1f1dSLionel Sambuc } 42*0a6a1f1dSLionel Sambuc 43*0a6a1f1dSLionel Sambuc template<typename T> struct MergePatternDecl; 44*0a6a1f1dSLionel Sambuc 45*0a6a1f1dSLionel Sambuc extern template struct ExplicitInstantiation<false, false>; 46*0a6a1f1dSLionel Sambuc extern template struct ExplicitInstantiation<false, true>; 47*0a6a1f1dSLionel Sambuc extern template struct ExplicitInstantiation<true, false>; 48*0a6a1f1dSLionel Sambuc extern template struct ExplicitInstantiation<true, true>; 49*0a6a1f1dSLionel Sambuc 50*0a6a1f1dSLionel Sambuc void useExplicitInstantiation() { 51*0a6a1f1dSLionel Sambuc ExplicitInstantiation<true, false>().f(); 52*0a6a1f1dSLionel Sambuc ExplicitInstantiation<true, true>().f(); 53*0a6a1f1dSLionel Sambuc } 54*0a6a1f1dSLionel Sambuc 55*0a6a1f1dSLionel Sambuc template<typename> struct DelayUpdates; 56*0a6a1f1dSLionel Sambuc template<> struct DelayUpdates<int>; 57*0a6a1f1dSLionel Sambuc template<typename T> struct DelayUpdates<T*>; 58*0a6a1f1dSLionel Sambuc template<typename T> void testDelayUpdates(DelayUpdates<T> *p = 0) {} 59*0a6a1f1dSLionel Sambuc 60*0a6a1f1dSLionel Sambuc void outOfLineInlineUseLeftF(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::f); 61*0a6a1f1dSLionel Sambuc void outOfLineInlineUseLeftG(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::g); 62*0a6a1f1dSLionel Sambuc void outOfLineInlineUseLeftH(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::h); 63*0a6a1f1dSLionel Sambuc 64*0a6a1f1dSLionel Sambuc namespace EmitDefaultedSpecialMembers { 65*0a6a1f1dSLionel Sambuc inline void f() { 66*0a6a1f1dSLionel Sambuc SmallString<256> SS; 67*0a6a1f1dSLionel Sambuc }; 68*0a6a1f1dSLionel Sambuc } 69*0a6a1f1dSLionel Sambuc 70*0a6a1f1dSLionel Sambuc inline int *getStaticDataMemberLeft() { 71*0a6a1f1dSLionel Sambuc return WithUndefinedStaticDataMember<int[]>::undefined; 72*0a6a1f1dSLionel Sambuc } 73