blob: 2bd79be9458487d68f7c98979b4ec542665ca0d5 [file] [log] [blame]
Douglas Gregor1b257af2012-12-11 22:11:52 +00001@import templates_top;
Axel Naumann39d26c32012-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 Smith4ed01222013-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 Naumann39d26c32012-10-02 09:09:43 +000026template <typename T>
Axel Naumann38c3bb42012-10-02 12:18:46 +000027void pendingInstantiationEmit(T) {}
Axel Naumann39d26c32012-10-02 09:09:43 +000028void triggerPendingInstantiation() {
Axel Naumann38c3bb42012-10-02 12:18:46 +000029 pendingInstantiationEmit(12);
30 pendingInstantiationEmit(42.);
Axel Naumann39d26c32012-10-02 09:09:43 +000031}
Axel Naumann38c3bb42012-10-02 12:18:46 +000032
33void redeclDefinitionEmit(){}
Richard Smithb60fae52013-09-09 16:55:27 +000034
35typedef Outer<int>::Inner OuterIntInner_left;
Stephen Hines6bcf27b2014-05-29 04:14:42 -070036
37int defineListDoubleLeft() {
38 List<double> ld;
39 ld.push_back(0.0);
40 return ld.size;
41}
42
43template<typename T> struct MergePatternDecl;
44
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}
54
55template<typename> struct DelayUpdates;
56template<> struct DelayUpdates<int>;
57template<typename T> struct DelayUpdates<T*>;
58template<typename T> void testDelayUpdates(DelayUpdates<T> *p = 0) {}
Stephen Hinesef822542014-07-21 00:47:37 -070059
60void outOfLineInlineUseLeftF(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::f);
61void outOfLineInlineUseLeftG(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::g);
62void outOfLineInlineUseLeftH(void (OutOfLineInline<int>::*)() = &OutOfLineInline<int>::h);