blob: 4f7abeef1fa061b640dbee158f94c17c97f23be2 [file] [log] [blame]
Douglas Gregorc50d4922012-12-11 22:11:52 +00001@import templates_top;
Axel Naumann63469422c2012-10-02 09:09:43 +00002
3template<typename T> class Vector;
4
5template<typename T> class Vector;
6
7template<typename T> class List;
8template<> class List<bool> {
9public:
10 void push_back(int);
11};
12namespace N {
13 template<typename T> class Set;
14}
15namespace N {
16 template<typename T> class Set {
17 public:
18 void insert(T);
19 };
20}
21
Richard Smith0b87e072013-10-07 08:02:11 +000022constexpr unsigned List<int>::*size_left = &List<int>::size;
23List<int> list_left = { 0, 8 };
24typedef List<int> ListInt_left;
25
Axel Naumann63469422c2012-10-02 09:09:43 +000026template <typename T>
Axel Naumannd9a25b32012-10-02 12:18:46 +000027void pendingInstantiationEmit(T) {}
Axel Naumann63469422c2012-10-02 09:09:43 +000028void triggerPendingInstantiation() {
Axel Naumannd9a25b32012-10-02 12:18:46 +000029 pendingInstantiationEmit(12);
30 pendingInstantiationEmit(42.);
Axel Naumann63469422c2012-10-02 09:09:43 +000031}
Axel Naumannd9a25b32012-10-02 12:18:46 +000032
33void redeclDefinitionEmit(){}
Richard Smithd55889a2013-09-09 16:55:27 +000034
35typedef Outer<int>::Inner OuterIntInner_left;
Richard Smithcd45dbc2014-04-19 03:48:30 +000036
37int defineListDoubleLeft() {
38 List<double> ld;
39 ld.push_back(0.0);
40 return ld.size;
41}
Richard Smithf17fdbd2014-04-24 02:25:27 +000042
43template<typename T> struct MergePatternDecl;
Richard Smitheb36ddf2014-04-24 22:45:46 +000044
45extern template struct ExplicitInstantiation<false, false>;
46extern template struct ExplicitInstantiation<false, true>;
47extern template struct ExplicitInstantiation<true, false>;
48extern template struct ExplicitInstantiation<true, true>;
49
50void useExplicitInstantiation() {
51 ExplicitInstantiation<true, false>().f();
52 ExplicitInstantiation<true, true>().f();
53}
Richard Smithd1c46742014-04-30 02:24:17 +000054
55template<typename> struct DelayUpdates;
56template<> struct DelayUpdates<int>;
57template<typename T> struct DelayUpdates<T*>;
58template<typename T> void testDelayUpdates(DelayUpdates<T> *p = 0) {}
Richard Smith195d8ef2014-05-29 03:15:31 +000059
60void outOfLineInlineUseLeftF(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::f);
61void outOfLineInlineUseLeftG(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::g);
62void outOfLineInlineUseLeftH(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::h);
Richard Smith462b6fc2014-08-14 20:30:52 +000063
64namespace EmitDefaultedSpecialMembers {
65 inline void f() {
66 SmallString<256> SS;
67 };
68}
Richard Smith73b21d82014-09-03 02:33:22 +000069
70inline int *getStaticDataMemberLeft() {
71 return WithUndefinedStaticDataMember<int[]>::undefined;
72}
Richard Smith842e46e2016-10-26 02:31:56 +000073
74inline WithAttributes<int> make_with_attributes_left() { return WithAttributes<int>(); }