blob: c4f60e399216af0dd189b25498f4669a95acb0d3 [file] [log] [blame]
Douglas Gregordc355712011-02-25 00:36:19 +00001namespace outer {
2 namespace inner {
3 template<typename T>
4 struct vector {
5 typedef T* iterator;
6 };
7 }
8}
9
10namespace outer_alias = outer;
11
12struct X { };
13
14using outer_alias::inner::vector;
15
16struct X_vector : outer_alias::inner::vector<X> {
17 using outer_alias::inner::vector<X>::iterator;
18};
19
Douglas Gregorc22b5ff2011-02-25 02:25:35 +000020namespace outer {
21 namespace inner {
22 template<typename T, unsigned N>
23 struct array {
24 void foo();
25 static int max_size;
26 };
27 }
28}
Douglas Gregordc355712011-02-25 00:36:19 +000029
Douglas Gregorc22b5ff2011-02-25 02:25:35 +000030template<typename T, unsigned N>
31void outer::inner::array<T, N>::foo() {
32}
Douglas Gregordc355712011-02-25 00:36:19 +000033
Douglas Gregorc22b5ff2011-02-25 02:25:35 +000034template<typename T, unsigned N>
35int outer::inner::array<T, N>::max_size = 17;
36
Douglas Gregora8eef312011-02-25 16:13:46 +000037template<typename T>
38struct X2 : outer::inner::vector<T> {
39 typedef T type;
40 using typename outer::inner::vector<type>::iterator;
41 using outer::inner::vector<type>::push_back;
42};
43
Douglas Gregordb992412011-02-25 16:33:46 +000044namespace outer {
45 namespace inner {
46 namespace secret {
47 }
48 }
49}
50
51using namespace outer_alias::inner::secret;
Douglas Gregor0cfaf6a2011-02-25 17:08:07 +000052namespace super_secret = outer_alias::inner::secret;
Douglas Gregordb992412011-02-25 16:33:46 +000053
Douglas Gregorf3db29f2011-02-25 18:19:59 +000054template<typename T>
55struct X3 {
56 void f(T *t) {
57 t->::outer_alias::inner::template vector<T>::~vector<T>();
58 }
59};
60
Douglas Gregor4c9be892011-02-28 20:01:57 +000061namespace outer {
62 namespace inner {
63 void f(int);
Douglas Gregor40d96a62011-02-28 21:54:11 +000064 void f(double);
Douglas Gregor4c9be892011-02-28 20:01:57 +000065 }
66}
67
68template<typename T>
69struct X4 {
70 typedef T type;
71 void g(int);
72 void g(float);
73
74 void h(T t) {
75 ::outer_alias::inner::f(t);
76 ::X4<type>::g(t);
77 this->::X4<type>::g(t);
78 }
79};
80
Douglas Gregor40d96a62011-02-28 21:54:11 +000081typedef int Integer;
82template<>
83struct X4<Integer> {
84 typedef Integer type;
85
86 void g(int);
87 void g(float);
88
89 void h(type t) {
90 ::outer_alias::inner::f(t);
91 ::X4<type>::g(t);
92 this->::X4<type>::g(t);
93 }
94};
95
Douglas Gregor2494dd02011-03-01 01:34:45 +000096
97template<typename T>
98struct X5 {
99 typedef T type;
100 typedef typename outer_alias::inner::vector<type>::iterator iter_type;
101 typedef typename outer_alias::inner::vector<int>::iterator int_ptr_type;
102};
103
Douglas Gregor94fdffa2011-03-01 20:11:18 +0000104template<typename T>
105struct X6 {
Douglas Gregor059101f2011-03-02 00:47:37 +0000106 typedef T* type;
Douglas Gregor94fdffa2011-03-01 20:11:18 +0000107 typedef typename outer_alias::inner::vector<type>::template rebind<type> type1;
108 typedef typename outer_alias::inner::vector<type>::template rebind<type>::other type2;
Douglas Gregor059101f2011-03-02 00:47:37 +0000109 typedef class outer_alias::inner::vector<type>::template rebind<type> type3;
110 typedef class outer_alias::inner::vector<type>::template rebind<type>::other type4;
Douglas Gregor94fdffa2011-03-01 20:11:18 +0000111};
112
Douglas Gregorb6744ef2011-03-02 17:09:35 +0000113namespace outer {
114 namespace inner {
115 template<typename T, template<class> class TT>
116 struct apply_meta {
117 typedef typename TT<T>::type type;
118 };
119 }
120}
121
122template<typename T, typename U>
123struct X7 {
124 typedef T T_type;
125 typedef U U_type;
126 typedef outer_alias::inner::apply_meta<T_type, U_type::template apply> type;
127};
128
Douglas Gregor75e85042011-03-02 21:06:53 +0000129struct X8 {
130 void f();
131};
132
133struct X9 : X8 {
134 typedef X8 inherited;
135 void f() {
136 inherited::f();
137 }
138};
139
Francois Pichet8efcc012011-09-01 16:38:08 +0000140// RUN: c-index-test -test-annotate-tokens=%s:13:1:137:1 -fno-delayed-template-parsing %s | FileCheck %s
Douglas Gregordc355712011-02-25 00:36:19 +0000141
142// CHECK: Keyword: "using" [14:1 - 14:6] UsingDeclaration=vector[4:12]
143// CHECK: Identifier: "outer_alias" [14:7 - 14:18] NamespaceRef=outer_alias:10:11
144// CHECK: Punctuation: "::" [14:18 - 14:20] UsingDeclaration=vector[4:12]
145// CHECK: Identifier: "inner" [14:20 - 14:25] NamespaceRef=inner:2:13
146// CHECK: Punctuation: "::" [14:25 - 14:27] UsingDeclaration=vector[4:12]
147// CHECK: Identifier: "vector" [14:27 - 14:33] OverloadedDeclRef=vector[4:12]
148// CHECK: Punctuation: ";" [14:33 - 14:34]
Douglas Gregorc314aa42011-03-02 19:17:03 +0000149
150// Base specifiers
151// CHECK: Identifier: "outer_alias" [16:19 - 16:30] NamespaceRef=outer_alias:10:11
Abramo Bagnara0daaf322011-03-16 20:16:18 +0000152// CHECK: Punctuation: "::" [16:30 - 16:32] C++ base class specifier=outer_alias::inner::vector<X>:4:12 [access=public isVirtual=false]
Douglas Gregorc314aa42011-03-02 19:17:03 +0000153// CHECK: Identifier: "inner" [16:32 - 16:37] NamespaceRef=inner:2:13
Abramo Bagnara0daaf322011-03-16 20:16:18 +0000154// CHECK: Punctuation: "::" [16:37 - 16:39] C++ base class specifier=outer_alias::inner::vector<X>:4:12 [access=public isVirtual=false]
Douglas Gregorc314aa42011-03-02 19:17:03 +0000155// CHECK: Identifier: "vector" [16:39 - 16:45] TemplateRef=vector:4:12
Abramo Bagnara0daaf322011-03-16 20:16:18 +0000156// CHECK: Punctuation: "<" [16:45 - 16:46] C++ base class specifier=outer_alias::inner::vector<X>:4:12 [access=public isVirtual=false]
Douglas Gregorc314aa42011-03-02 19:17:03 +0000157// CHECK: Identifier: "X" [16:46 - 16:47] TypeRef=struct X:12:8
Abramo Bagnara0daaf322011-03-16 20:16:18 +0000158// CHECK: Punctuation: ">" [16:47 - 16:48] C++ base class specifier=outer_alias::inner::vector<X>:4:12 [access=public isVirtual=false]
Douglas Gregorc314aa42011-03-02 19:17:03 +0000159
160
Douglas Gregordc355712011-02-25 00:36:19 +0000161// CHECK: Keyword: "using" [17:3 - 17:8] UsingDeclaration=iterator[5:18]
162// CHECK: Identifier: "outer_alias" [17:9 - 17:20] NamespaceRef=outer_alias:10:11
163// CHECK: Punctuation: "::" [17:20 - 17:22] UsingDeclaration=iterator[5:18]
164// CHECK: Identifier: "inner" [17:22 - 17:27] NamespaceRef=inner:2:13
165// CHECK: Punctuation: "::" [17:27 - 17:29] UsingDeclaration=iterator[5:18]
166// CHECK: Identifier: "vector" [17:29 - 17:35] TemplateRef=vector:4:12
167// CHECK: Punctuation: "<" [17:35 - 17:36] UsingDeclaration=iterator[5:18]
168// CHECK: Identifier: "X" [17:36 - 17:37] TypeRef=struct X:12:8
169// CHECK: Punctuation: ">" [17:37 - 17:38] UsingDeclaration=iterator[5:18]
170// CHECK: Punctuation: "::" [17:38 - 17:40] UsingDeclaration=iterator[5:18]
171// CHECK: Identifier: "iterator" [17:40 - 17:48] OverloadedDeclRef=iterator[5:18]
Douglas Gregorc22b5ff2011-02-25 02:25:35 +0000172
Douglas Gregor2494dd02011-03-01 01:34:45 +0000173// CHECK: Keyword: "void" [31:1 - 31:5] CXXMethod=foo:31:33 (Definition)
174// CHECK: Identifier: "outer" [31:6 - 31:11] NamespaceRef=outer:20:11
175// CHECK: Punctuation: "::" [31:11 - 31:13] CXXMethod=foo:31:33 (Definition)
176// CHECK: Identifier: "inner" [31:13 - 31:18] NamespaceRef=inner:21:13
177// CHECK: Punctuation: "::" [31:18 - 31:20] CXXMethod=foo:31:33 (Definition)
178// CHECK: Identifier: "array" [31:20 - 31:25] TemplateRef=array:23:12
179// CHECK: Punctuation: "<" [31:25 - 31:26] CXXMethod=foo:31:33 (Definition)
Chandler Carruth960d13d2011-05-01 09:53:37 +0000180// CHECK: Identifier: "T" [31:26 - 31:27] TypeRef=T:30:19
Douglas Gregor2494dd02011-03-01 01:34:45 +0000181// CHECK: Punctuation: "," [31:27 - 31:28] CXXMethod=foo:31:33 (Definition)
182// CHECK: Identifier: "N" [31:29 - 31:30] DeclRefExpr=N:30:31
183// CHECK: Punctuation: ">" [31:30 - 31:31] CXXMethod=foo:31:33 (Definition)
184// CHECK: Punctuation: "::" [31:31 - 31:33] CXXMethod=foo:31:33 (Definition)
185// CHECK: Identifier: "foo" [31:33 - 31:36] CXXMethod=foo:31:33 (Definition)
186// CHECK: Punctuation: "(" [31:36 - 31:37] CXXMethod=foo:31:33 (Definition)
187// CHECK: Punctuation: ")" [31:37 - 31:38] CXXMethod=foo:31:33 (Definition)
188
189// CHECK: Keyword: "int" [35:1 - 35:4] VarDecl=max_size:35:32 (Definition)
190// CHECK: Identifier: "outer" [35:5 - 35:10] NamespaceRef=outer:20:11
191// CHECK: Punctuation: "::" [35:10 - 35:12] VarDecl=max_size:35:32 (Definition)
192// CHECK: Identifier: "inner" [35:12 - 35:17] NamespaceRef=inner:21:13
193// CHECK: Punctuation: "::" [35:17 - 35:19] VarDecl=max_size:35:32 (Definition)
194// CHECK: Identifier: "array" [35:19 - 35:24] TemplateRef=array:23:12
195// CHECK: Punctuation: "<" [35:24 - 35:25] VarDecl=max_size:35:32 (Definition)
Chandler Carruth960d13d2011-05-01 09:53:37 +0000196// CHECK: Identifier: "T" [35:25 - 35:26] TypeRef=T:34:19
Douglas Gregor2494dd02011-03-01 01:34:45 +0000197// CHECK: Punctuation: "," [35:26 - 35:27] VarDecl=max_size:35:32 (Definition)
198// CHECK: Identifier: "N" [35:28 - 35:29] DeclRefExpr=N:34:31
199// CHECK: Punctuation: ">" [35:29 - 35:30] VarDecl=max_size:35:32 (Definition)
200// CHECK: Punctuation: "::" [35:30 - 35:32] VarDecl=max_size:35:32 (Definition)
201// CHECK: Identifier: "max_size" [35:32 - 35:40] VarDecl=max_size:35:32 (Definition)
202// CHECK: Punctuation: "=" [35:41 - 35:42] VarDecl=max_size:35:32 (Definition)
Douglas Gregor42b29842011-10-05 19:00:14 +0000203// CHECK: Literal: "17" [35:43 - 35:45] IntegerLiteral=
Douglas Gregor2494dd02011-03-01 01:34:45 +0000204// CHECK: Punctuation: ";" [35:45 - 35:46]
Douglas Gregora8eef312011-02-25 16:13:46 +0000205
206// CHECK: Keyword: "using" [40:3 - 40:8] UsingDeclaration=iterator:40:46
207// CHECK: Keyword: "typename" [40:9 - 40:17] UsingDeclaration=iterator:40:46
208// CHECK: Identifier: "outer" [40:18 - 40:23] NamespaceRef=outer:20:11
209// CHECK: Punctuation: "::" [40:23 - 40:25] UsingDeclaration=iterator:40:46
210// CHECK: Identifier: "inner" [40:25 - 40:30] NamespaceRef=inner:21:13
211// CHECK: Punctuation: "::" [40:30 - 40:32] UsingDeclaration=iterator:40:46
212// CHECK: Identifier: "vector" [40:32 - 40:38] TemplateRef=vector:4:12
213// CHECK: Punctuation: "<" [40:38 - 40:39] UsingDeclaration=iterator:40:46
214// CHECK: Identifier: "type" [40:39 - 40:43] TypeRef=type:39:13
215// CHECK: Punctuation: ">" [40:43 - 40:44] UsingDeclaration=iterator:40:46
216// CHECK: Punctuation: "::" [40:44 - 40:46] UsingDeclaration=iterator:40:46
217// CHECK: Identifier: "iterator" [40:46 - 40:54] UsingDeclaration=iterator:40:46
218// CHECK: Punctuation: ";" [40:54 - 40:55] ClassTemplate=X2:38:8 (Definition)
219// CHECK: Keyword: "using" [41:3 - 41:8] UsingDeclaration=push_back:41:37
220// CHECK: Identifier: "outer" [41:9 - 41:14] NamespaceRef=outer:20:11
221// CHECK: Punctuation: "::" [41:14 - 41:16] UsingDeclaration=push_back:41:37
222// CHECK: Identifier: "inner" [41:16 - 41:21] NamespaceRef=inner:21:13
223// CHECK: Punctuation: "::" [41:21 - 41:23] UsingDeclaration=push_back:41:37
224// CHECK: Identifier: "vector" [41:23 - 41:29] TemplateRef=vector:4:12
225// CHECK: Punctuation: "<" [41:29 - 41:30] UsingDeclaration=push_back:41:37
226// CHECK: Identifier: "type" [41:30 - 41:34] TypeRef=type:39:13
227// CHECK: Punctuation: ">" [41:34 - 41:35] UsingDeclaration=push_back:41:37
228// CHECK: Punctuation: "::" [41:35 - 41:37] UsingDeclaration=push_back:41:37
229// CHECK: Identifier: "push_back" [41:37 - 41:46] UsingDeclaration=push_back:41:37
Douglas Gregordb992412011-02-25 16:33:46 +0000230
231// Using directive
232// CHECK: Keyword: "using" [51:1 - 51:6] UsingDirective=:51:37
233// CHECK: Keyword: "namespace" [51:7 - 51:16] UsingDirective=:51:37
234// CHECK: Identifier: "outer_alias" [51:17 - 51:28] NamespaceRef=outer_alias:10:11
235// CHECK: Punctuation: "::" [51:28 - 51:30] UsingDirective=:51:37
236// CHECK: Identifier: "inner" [51:30 - 51:35] NamespaceRef=inner:45:13
237// CHECK: Punctuation: "::" [51:35 - 51:37] UsingDirective=:51:37
238// CHECK: Identifier: "secret" [51:37 - 51:43] NamespaceRef=secret:46:15
Douglas Gregor0cfaf6a2011-02-25 17:08:07 +0000239
240// Namespace alias
241// CHECK: Keyword: "namespace" [52:1 - 52:10] NamespaceAlias=super_secret:52:11
242// CHECK: Identifier: "super_secret" [52:11 - 52:23] NamespaceAlias=super_secret:52:11
243// CHECK: Punctuation: "=" [52:24 - 52:25] NamespaceAlias=super_secret:52:11
244// CHECK: Identifier: "outer_alias" [52:26 - 52:37] NamespaceRef=outer_alias:10:11
245// CHECK: Punctuation: "::" [52:37 - 52:39] NamespaceAlias=super_secret:52:11
246// CHECK: Identifier: "inner" [52:39 - 52:44] NamespaceRef=inner:45:13
247// CHECK: Punctuation: "::" [52:44 - 52:46] NamespaceAlias=super_secret:52:11
248// CHECK: Identifier: "secret" [52:46 - 52:52] NamespaceRef=secret:46:15
249// CHECK: Punctuation: ";" [52:52 - 52:53]
250
Douglas Gregorf3db29f2011-02-25 18:19:59 +0000251// Pseudo-destructor
252// CHECK: Identifier: "t" [57:5 - 57:6] DeclRefExpr=t:56:13
Douglas Gregor42b29842011-10-05 19:00:14 +0000253// CHECK: Punctuation: "->" [57:6 - 57:8] MemberRefExpr=
254// CHECK: Punctuation: "::" [57:8 - 57:10] MemberRefExpr=
Douglas Gregorf3db29f2011-02-25 18:19:59 +0000255// CHECK: Identifier: "outer_alias" [57:10 - 57:21] NamespaceRef=outer_alias:10:11
Douglas Gregor42b29842011-10-05 19:00:14 +0000256// CHECK: Punctuation: "::" [57:21 - 57:23] MemberRefExpr=
Douglas Gregorf3db29f2011-02-25 18:19:59 +0000257// CHECK: Identifier: "inner" [57:23 - 57:28] NamespaceRef=inner:45:13
Douglas Gregor42b29842011-10-05 19:00:14 +0000258// CHECK: Punctuation: "::" [57:28 - 57:30] MemberRefExpr=
259// CHECK: Keyword: "template" [57:30 - 57:38] MemberRefExpr=
Douglas Gregorf3db29f2011-02-25 18:19:59 +0000260// CHECK: Identifier: "vector" [57:39 - 57:45] TemplateRef=vector:4:12
Douglas Gregor42b29842011-10-05 19:00:14 +0000261// CHECK: Punctuation: "<" [57:45 - 57:46] MemberRefExpr=
Chandler Carruth960d13d2011-05-01 09:53:37 +0000262// CHECK: Identifier: "T" [57:46 - 57:47] TypeRef=T:54:19
Douglas Gregor42b29842011-10-05 19:00:14 +0000263// CHECK: Punctuation: ">" [57:47 - 57:48] MemberRefExpr=
264// CHECK: Punctuation: "::" [57:48 - 57:50] MemberRefExpr=
265// CHECK: Punctuation: "~" [57:50 - 57:51] MemberRefExpr=
Douglas Gregorf3db29f2011-02-25 18:19:59 +0000266// CHECK: Identifier: "vector" [57:51 - 57:57] TemplateRef=vector:4:12
Douglas Gregor42b29842011-10-05 19:00:14 +0000267// CHECK: Punctuation: "<" [57:57 - 57:58] MemberRefExpr=
Chandler Carruth960d13d2011-05-01 09:53:37 +0000268// CHECK: Identifier: "T" [57:58 - 57:59] TypeRef=T:54:19
Douglas Gregor059101f2011-03-02 00:47:37 +0000269// CHECK: Punctuation: ">" [57:59 - 57:60] CallExpr=
Douglas Gregorf3db29f2011-02-25 18:19:59 +0000270// CHECK: Punctuation: "(" [57:60 - 57:61] CallExpr=
271// CHECK: Punctuation: ")" [57:61 - 57:62] CallExpr=
Douglas Gregor4c9be892011-02-28 20:01:57 +0000272
273// Unresolved member and non-member references
Douglas Gregor42b29842011-10-05 19:00:14 +0000274// CHECK: Punctuation: "::" [75:5 - 75:7] DeclRefExpr=[63:10, 64:10]
Douglas Gregor4c9be892011-02-28 20:01:57 +0000275// CHECK: Identifier: "outer_alias" [75:7 - 75:18] NamespaceRef=outer_alias:10:11
Douglas Gregor42b29842011-10-05 19:00:14 +0000276// CHECK: Punctuation: "::" [75:18 - 75:20] DeclRefExpr=[63:10, 64:10]
Douglas Gregor4c9be892011-02-28 20:01:57 +0000277// CHECK: Identifier: "inner" [75:20 - 75:25] NamespaceRef=inner:62:13
Douglas Gregor42b29842011-10-05 19:00:14 +0000278// CHECK: Punctuation: "::" [75:25 - 75:27] DeclRefExpr=[63:10, 64:10]
Douglas Gregor4c9be892011-02-28 20:01:57 +0000279// CHECK: Identifier: "f" [75:27 - 75:28] OverloadedDeclRef=f[63:10, 64:10]
280// CHECK: Punctuation: "(" [75:28 - 75:29] CallExpr=
281// CHECK: Identifier: "t" [75:29 - 75:30] DeclRefExpr=t:74:12
282// CHECK: Punctuation: ")" [75:30 - 75:31] CallExpr=
Douglas Gregor42b29842011-10-05 19:00:14 +0000283// CHECK: Punctuation: "::" [76:5 - 76:7] MemberRefExpr=[71:8, 72:8]
Douglas Gregor4c9be892011-02-28 20:01:57 +0000284// CHECK: Identifier: "X4" [76:7 - 76:9] TemplateRef=X4:69:8
Douglas Gregor42b29842011-10-05 19:00:14 +0000285// CHECK: Punctuation: "<" [76:9 - 76:10] MemberRefExpr=[71:8, 72:8]
Douglas Gregor4c9be892011-02-28 20:01:57 +0000286// CHECK: Identifier: "type" [76:10 - 76:14] TypeRef=type:70:13
Douglas Gregor42b29842011-10-05 19:00:14 +0000287// CHECK: Punctuation: ">" [76:14 - 76:15] MemberRefExpr=[71:8, 72:8]
288// CHECK: Punctuation: "::" [76:15 - 76:17] MemberRefExpr=[71:8, 72:8]
Douglas Gregor4c9be892011-02-28 20:01:57 +0000289// CHECK: Identifier: "g" [76:17 - 76:18] OverloadedDeclRef=g[71:8, 72:8]
290// CHECK: Punctuation: "(" [76:18 - 76:19] CallExpr=
291// CHECK: Identifier: "t" [76:19 - 76:20] DeclRefExpr=t:74:12
292// CHECK: Punctuation: ")" [76:20 - 76:21] CallExpr=
Douglas Gregor42b29842011-10-05 19:00:14 +0000293// CHECK: Punctuation: ";" [76:21 - 76:22] CompoundStmt=
294// CHECK: Keyword: "this" [77:5 - 77:9] CXXThisExpr=
295// CHECK: Punctuation: "->" [77:9 - 77:11] MemberRefExpr=
296// CHECK: Punctuation: "::" [77:11 - 77:13] MemberRefExpr=
Douglas Gregor4c9be892011-02-28 20:01:57 +0000297// CHECK: Identifier: "X4" [77:13 - 77:15] TemplateRef=X4:69:8
Douglas Gregor42b29842011-10-05 19:00:14 +0000298// CHECK: Punctuation: "<" [77:15 - 77:16] MemberRefExpr=
Douglas Gregor4c9be892011-02-28 20:01:57 +0000299// CHECK: Identifier: "type" [77:16 - 77:20] TypeRef=type:70:13
Douglas Gregor42b29842011-10-05 19:00:14 +0000300// CHECK: Punctuation: ">" [77:20 - 77:21] MemberRefExpr=
301// CHECK: Punctuation: "::" [77:21 - 77:23] MemberRefExpr=
302// CHECK: Identifier: "g" [77:23 - 77:24] MemberRefExpr=
Douglas Gregor4c9be892011-02-28 20:01:57 +0000303// CHECK: Punctuation: "(" [77:24 - 77:25] CallExpr=
304// CHECK: Identifier: "t" [77:25 - 77:26] DeclRefExpr=t:74:12
305// CHECK: Punctuation: ")" [77:26 - 77:27] CallExpr=
Douglas Gregor40d96a62011-02-28 21:54:11 +0000306
307// Resolved member and non-member references
308// CHECK: Punctuation: "::" [90:5 - 90:7] DeclRefExpr=f:63:10
309// CHECK: Identifier: "outer_alias" [90:7 - 90:18] NamespaceRef=outer_alias:10:11
310// CHECK: Punctuation: "::" [90:18 - 90:20] DeclRefExpr=f:63:10
311// CHECK: Identifier: "inner" [90:20 - 90:25] NamespaceRef=inner:62:13
312// CHECK: Punctuation: "::" [90:25 - 90:27] DeclRefExpr=f:63:10
313// CHECK: Identifier: "f" [90:27 - 90:28] DeclRefExpr=f:63:10
314// CHECK: Punctuation: "(" [90:28 - 90:29] CallExpr=f:63:10
315// CHECK: Identifier: "t" [90:29 - 90:30] DeclRefExpr=t:89:15
316// CHECK: Punctuation: ")" [90:30 - 90:31] CallExpr=f:63:10
Douglas Gregor42b29842011-10-05 19:00:14 +0000317// CHECK: Punctuation: ";" [90:31 - 90:32] CompoundStmt=
Douglas Gregor40d96a62011-02-28 21:54:11 +0000318// CHECK: Punctuation: "::" [91:5 - 91:7] MemberRefExpr=g:86:8
319// CHECK: Identifier: "X4" [91:7 - 91:9] TemplateRef=X4:69:8
320// CHECK: Punctuation: "<" [91:9 - 91:10] MemberRefExpr=g:86:8
321// CHECK: Identifier: "type" [91:10 - 91:14] TypeRef=type:84:19
322// CHECK: Punctuation: ">" [91:14 - 91:15] MemberRefExpr=g:86:8
323// CHECK: Punctuation: "::" [91:15 - 91:17] MemberRefExpr=g:86:8
324// CHECK: Identifier: "g" [91:17 - 91:18] MemberRefExpr=g:86:8
325// CHECK: Punctuation: "(" [91:18 - 91:19] CallExpr=g:86:8
326// CHECK: Identifier: "t" [91:19 - 91:20] DeclRefExpr=t:89:15
327// CHECK: Punctuation: ")" [91:20 - 91:21] CallExpr=g:86:8
Douglas Gregor42b29842011-10-05 19:00:14 +0000328// CHECK: Punctuation: ";" [91:21 - 91:22] CompoundStmt=
329// CHECK: Keyword: "this" [92:5 - 92:9] CXXThisExpr=
Douglas Gregor40d96a62011-02-28 21:54:11 +0000330// CHECK: Punctuation: "->" [92:9 - 92:11] MemberRefExpr=g:86:8
331// CHECK: Punctuation: "::" [92:11 - 92:13] MemberRefExpr=g:86:8
332// CHECK: Identifier: "X4" [92:13 - 92:15] TemplateRef=X4:69:8
333// CHECK: Punctuation: "<" [92:15 - 92:16] MemberRefExpr=g:86:8
334// CHECK: Identifier: "type" [92:16 - 92:20] TypeRef=type:84:19
335// CHECK: Punctuation: ">" [92:20 - 92:21] MemberRefExpr=g:86:8
336// CHECK: Punctuation: "::" [92:21 - 92:23] MemberRefExpr=g:86:8
337// CHECK: Identifier: "g" [92:23 - 92:24] MemberRefExpr=g:86:8
338// CHECK: Punctuation: "(" [92:24 - 92:25] CallExpr=g:86:8
339// CHECK: Identifier: "t" [92:25 - 92:26] DeclRefExpr=t:89:15
340// CHECK: Punctuation: ")" [92:26 - 92:27] CallExpr=g:86:8
Douglas Gregor2494dd02011-03-01 01:34:45 +0000341
342// Dependent name type
343// CHECK: Keyword: "typedef" [100:3 - 100:10] ClassTemplate=X5:98:8 (Definition)
344// CHECK: Keyword: "typename" [100:11 - 100:19] TypedefDecl=iter_type:100:63 (Definition)
345// CHECK: Identifier: "outer_alias" [100:20 - 100:31] NamespaceRef=outer_alias:10:11
346// CHECK: Punctuation: "::" [100:31 - 100:33] TypedefDecl=iter_type:100:63 (Definition)
347// CHECK: Identifier: "inner" [100:33 - 100:38] NamespaceRef=inner:62:13
348// CHECK: Punctuation: "::" [100:38 - 100:40] TypedefDecl=iter_type:100:63 (Definition)
349// CHECK: Identifier: "vector" [100:40 - 100:46] TemplateRef=vector:4:12
350// CHECK: Punctuation: "<" [100:46 - 100:47] TypedefDecl=iter_type:100:63 (Definition)
351// CHECK: Identifier: "type" [100:47 - 100:51] TypeRef=type:99:13
352// CHECK: Punctuation: ">" [100:51 - 100:52] TypedefDecl=iter_type:100:63 (Definition)
353// CHECK: Punctuation: "::" [100:52 - 100:54] TypedefDecl=iter_type:100:63 (Definition)
354// CHECK: Identifier: "iterator" [100:54 - 100:62] TypedefDecl=iter_type:100:63 (Definition)
355// CHECK: Identifier: "iter_type" [100:63 - 100:72] TypedefDecl=iter_type:100:63 (Definition)
356
Douglas Gregor9e876872011-03-01 18:12:44 +0000357// CHECK: Keyword: "typedef" [101:3 - 101:10] ClassTemplate=X5:98:8 (Definition)
358// CHECK: Keyword: "typename" [101:11 - 101:19] TypedefDecl=int_ptr_type:101:62 (Definition)
359// CHECK: Identifier: "outer_alias" [101:20 - 101:31] NamespaceRef=outer_alias:10:11
360// CHECK: Punctuation: "::" [101:31 - 101:33] TypedefDecl=int_ptr_type:101:62 (Definition)
361// CHECK: Identifier: "inner" [101:33 - 101:38] NamespaceRef=inner:62:13
362// CHECK: Punctuation: "::" [101:38 - 101:40] TypedefDecl=int_ptr_type:101:62 (Definition)
363// CHECK: Identifier: "vector" [101:40 - 101:46] TemplateRef=vector:4:12
364// CHECK: Punctuation: "<" [101:46 - 101:47] TypedefDecl=int_ptr_type:101:62 (Definition)
365// CHECK: Keyword: "int" [101:47 - 101:50] TypedefDecl=int_ptr_type:101:62 (Definition)
366// CHECK: Punctuation: ">" [101:50 - 101:51] TypedefDecl=int_ptr_type:101:62 (Definition)
367// CHECK: Punctuation: "::" [101:51 - 101:53] TypedefDecl=int_ptr_type:101:62 (Definition)
368// CHECK: Identifier: "iterator" [101:53 - 101:61] TypeRef=iterator:5:18
369// CHECK: Identifier: "int_ptr_type" [101:62 - 101:74] TypedefDecl=int_ptr_type:101:62 (Definition)
Douglas Gregor2494dd02011-03-01 01:34:45 +0000370
Douglas Gregor94fdffa2011-03-01 20:11:18 +0000371// Dependent template specialization types
372// CHECK: Keyword: "typename" [107:11 - 107:19] TypedefDecl=type1:107:76 (Definition)
373// CHECK: Identifier: "outer_alias" [107:20 - 107:31] NamespaceRef=outer_alias:10:11
374// CHECK: Punctuation: "::" [107:31 - 107:33] TypedefDecl=type1:107:76 (Definition)
375// CHECK: Identifier: "inner" [107:33 - 107:38] NamespaceRef=inner:62:13
376// CHECK: Punctuation: "::" [107:38 - 107:40] TypedefDecl=type1:107:76 (Definition)
377// CHECK: Identifier: "vector" [107:40 - 107:46] TemplateRef=vector:4:12
378// CHECK: Punctuation: "<" [107:46 - 107:47] TypedefDecl=type1:107:76 (Definition)
Douglas Gregor059101f2011-03-02 00:47:37 +0000379// CHECK: Identifier: "type" [107:47 - 107:51] TypeRef=type:106:14
Douglas Gregor94fdffa2011-03-01 20:11:18 +0000380// CHECK: Punctuation: ">" [107:51 - 107:52] TypedefDecl=type1:107:76 (Definition)
381// CHECK: Punctuation: "::" [107:52 - 107:54] TypedefDecl=type1:107:76 (Definition)
382// CHECK: Keyword: "template" [107:54 - 107:62] TypedefDecl=type1:107:76 (Definition)
383// CHECK: Identifier: "rebind" [107:63 - 107:69] TypedefDecl=type1:107:76 (Definition)
384// CHECK: Punctuation: "<" [107:69 - 107:70] TypedefDecl=type1:107:76 (Definition)
Douglas Gregor059101f2011-03-02 00:47:37 +0000385// CHECK: Identifier: "type" [107:70 - 107:74] TypeRef=type:106:14
Douglas Gregor94fdffa2011-03-01 20:11:18 +0000386// CHECK: Punctuation: ">" [107:74 - 107:75] TypedefDecl=type1:107:76 (Definition)
387// CHECK: Identifier: "type1" [107:76 - 107:81] TypedefDecl=type1:107:76 (Definition)
388
389// CHECK: Keyword: "typedef" [108:3 - 108:10] ClassTemplate=X6:105:8 (Definition)
390// CHECK: Keyword: "typename" [108:11 - 108:19] TypedefDecl=type2:108:83 (Definition)
391// CHECK: Identifier: "outer_alias" [108:20 - 108:31] NamespaceRef=outer_alias:10:11
392// CHECK: Punctuation: "::" [108:31 - 108:33] TypedefDecl=type2:108:83 (Definition)
393// CHECK: Identifier: "inner" [108:33 - 108:38] NamespaceRef=inner:62:13
394// CHECK: Punctuation: "::" [108:38 - 108:40] TypedefDecl=type2:108:83 (Definition)
395// CHECK: Identifier: "vector" [108:40 - 108:46] TemplateRef=vector:4:12
396// CHECK: Punctuation: "<" [108:46 - 108:47] TypedefDecl=type2:108:83 (Definition)
Douglas Gregor059101f2011-03-02 00:47:37 +0000397// CHECK: Identifier: "type" [108:47 - 108:51] TypeRef=type:106:14
Douglas Gregor94fdffa2011-03-01 20:11:18 +0000398// CHECK: Punctuation: ">" [108:51 - 108:52] TypedefDecl=type2:108:83 (Definition)
399// CHECK: Punctuation: "::" [108:52 - 108:54] TypedefDecl=type2:108:83 (Definition)
400// CHECK: Keyword: "template" [108:54 - 108:62] TypedefDecl=type2:108:83 (Definition)
401// CHECK: Identifier: "rebind" [108:63 - 108:69] TypedefDecl=type2:108:83 (Definition)
402// CHECK: Punctuation: "<" [108:69 - 108:70] TypedefDecl=type2:108:83 (Definition)
Douglas Gregor059101f2011-03-02 00:47:37 +0000403// CHECK: Identifier: "type" [108:70 - 108:74] TypeRef=type:106:14
Douglas Gregor94fdffa2011-03-01 20:11:18 +0000404// CHECK: Punctuation: ">" [108:74 - 108:75] TypedefDecl=type2:108:83 (Definition)
405// CHECK: Punctuation: "::" [108:75 - 108:77] TypedefDecl=type2:108:83 (Definition)
406// CHECK: Identifier: "other" [108:77 - 108:82] TypedefDecl=type2:108:83 (Definition)
407// CHECK: Identifier: "type2" [108:83 - 108:88] TypedefDecl=type2:108:83 (Definition)
Douglas Gregor059101f2011-03-02 00:47:37 +0000408
409// CHECK: Keyword: "typedef" [109:3 - 109:10] ClassTemplate=X6:105:8 (Definition)
410// CHECK: Keyword: "class" [109:11 - 109:16] TypedefDecl=type3:109:73 (Definition)
411// CHECK: Identifier: "outer_alias" [109:17 - 109:28] NamespaceRef=outer_alias:10:11
412// CHECK: Punctuation: "::" [109:28 - 109:30] TypedefDecl=type3:109:73 (Definition)
413// CHECK: Identifier: "inner" [109:30 - 109:35] NamespaceRef=inner:62:13
414// CHECK: Punctuation: "::" [109:35 - 109:37] TypedefDecl=type3:109:73 (Definition)
415// CHECK: Identifier: "vector" [109:37 - 109:43] TemplateRef=vector:4:12
416// CHECK: Punctuation: "<" [109:43 - 109:44] TypedefDecl=type3:109:73 (Definition)
417// CHECK: Identifier: "type" [109:44 - 109:48] TypeRef=type:106:14
418// CHECK: Punctuation: ">" [109:48 - 109:49] TypedefDecl=type3:109:73 (Definition)
419// CHECK: Punctuation: "::" [109:49 - 109:51] TypedefDecl=type3:109:73 (Definition)
420// CHECK: Keyword: "template" [109:51 - 109:59] TypedefDecl=type3:109:73 (Definition)
421// CHECK: Identifier: "rebind" [109:60 - 109:66] TypedefDecl=type3:109:73 (Definition)
422// CHECK: Punctuation: "<" [109:66 - 109:67] TypedefDecl=type3:109:73 (Definition)
423// CHECK: Identifier: "type" [109:67 - 109:71] TypeRef=type:106:14
424// CHECK: Punctuation: ">" [109:71 - 109:72] TypedefDecl=type3:109:73 (Definition)
425// CHECK: Identifier: "type3" [109:73 - 109:78] TypedefDecl=type3:109:73 (Definition)
426
427// CHECK: Keyword: "class" [110:11 - 110:16] TypedefDecl=type4:110:80 (Definition)
428// CHECK: Identifier: "outer_alias" [110:17 - 110:28] NamespaceRef=outer_alias:10:11
429// CHECK: Punctuation: "::" [110:28 - 110:30] TypedefDecl=type4:110:80 (Definition)
430// CHECK: Identifier: "inner" [110:30 - 110:35] NamespaceRef=inner:62:13
431// CHECK: Punctuation: "::" [110:35 - 110:37] TypedefDecl=type4:110:80 (Definition)
432// CHECK: Identifier: "vector" [110:37 - 110:43] TemplateRef=vector:4:12
433// CHECK: Punctuation: "<" [110:43 - 110:44] TypedefDecl=type4:110:80 (Definition)
434// CHECK: Identifier: "type" [110:44 - 110:48] TypeRef=type:106:14
435// CHECK: Punctuation: ">" [110:48 - 110:49] TypedefDecl=type4:110:80 (Definition)
436// CHECK: Punctuation: "::" [110:49 - 110:51] TypedefDecl=type4:110:80 (Definition)
437// CHECK: Keyword: "template" [110:51 - 110:59] TypedefDecl=type4:110:80 (Definition)
438// CHECK: Identifier: "rebind" [110:60 - 110:66] TypedefDecl=type4:110:80 (Definition)
439// CHECK: Punctuation: "<" [110:66 - 110:67] TypedefDecl=type4:110:80 (Definition)
440// CHECK: Identifier: "type" [110:67 - 110:71] TypeRef=type:106:14
441// CHECK: Punctuation: ">" [110:71 - 110:72] TypedefDecl=type4:110:80 (Definition)
442// CHECK: Punctuation: "::" [110:72 - 110:74] TypedefDecl=type4:110:80 (Definition)
443// CHECK: Identifier: "other" [110:74 - 110:79] TypedefDecl=type4:110:80 (Definition)
444// CHECK: Identifier: "type4" [110:80 - 110:85] TypedefDecl=type4:110:80 (Definition)
Douglas Gregorb6744ef2011-03-02 17:09:35 +0000445
446// Template template arguments
447// CHECK: Keyword: "typedef" [126:3 - 126:10] ClassTemplate=X7:123:8 (Definition)
448// CHECK: Identifier: "outer_alias" [126:11 - 126:22] NamespaceRef=outer_alias:10:11
449// CHECK: Punctuation: "::" [126:22 - 126:24] TypedefDecl=type:126:74 (Definition)
450// CHECK: Identifier: "inner" [126:24 - 126:29] NamespaceRef=inner:114:13
451// CHECK: Punctuation: "::" [126:29 - 126:31] TypedefDecl=type:126:74 (Definition)
452// CHECK: Identifier: "apply_meta" [126:31 - 126:41] TemplateRef=apply_meta:116:12
453// CHECK: Punctuation: "<" [126:41 - 126:42] TypedefDecl=type:126:74 (Definition)
454// CHECK: Identifier: "T_type" [126:42 - 126:48] TypeRef=T_type:124:13
455// CHECK: Punctuation: "," [126:48 - 126:49] TypedefDecl=type:126:74 (Definition)
456// CHECK: Identifier: "U_type" [126:50 - 126:56] TypeRef=U_type:125:13
457// CHECK: Punctuation: "::" [126:56 - 126:58] TypedefDecl=type:126:74 (Definition)
458// CHECK: Keyword: "template" [126:58 - 126:66] TypedefDecl=type:126:74 (Definition)
459// CHECK: Identifier: "apply" [126:67 - 126:72] TypedefDecl=type:126:74 (Definition)
460// CHECK: Punctuation: ">" [126:72 - 126:73] TypedefDecl=type:126:74 (Definition)
461// CHECK: Identifier: "type" [126:74 - 126:78] TypedefDecl=type:126:74 (Definition)
462
Douglas Gregor75e85042011-03-02 21:06:53 +0000463// Member access expressions
464// CHECK: Identifier: "inherited" [136:5 - 136:14] TypeRef=inherited:134:14
465// CHECK: Punctuation: "::" [136:14 - 136:16] MemberRefExpr=f:130:8
466// CHECK: Identifier: "f" [136:16 - 136:17] MemberRefExpr=f:130:8