11 NS::MyInt
NS::gx
= EnumVal
;
43 using namespace NS::Inn
;
46 template <typename T1
, typename T2
>
58 const int array_size
= 3;
59 typedef int some_arr
[array_size
];
61 const int default_param
= 3;
62 void foo4(int p
= default_param
);
69 struct S2 s
= { .y
= 1, .x
= 4};
75 int ginitlist
[] = {EnumVal
};
77 // RUN: c-index-test -index-file %s | FileCheck %s
78 // CHECK: [indexDeclaration]: kind: namespace | name: NS
79 // CHECK-NEXT: [indexDeclaration]: kind: variable | name: gx
80 // CHECK-NEXT: [indexDeclaration]: kind: typedef | name: MyInt
81 // CHECK-NEXT: [indexDeclaration]: kind: enum
82 // CHECK-NEXT: [indexDeclaration]: kind: enumerator | name: EnumVal
83 // CHECK-NEXT: [indexDeclaration]: kind: variable | name: gx
84 // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS
85 // CHECK-NEXT: [indexEntityReference]: kind: typedef | name: MyInt
86 // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS
87 // CHECK-NEXT: [indexEntityReference]: kind: enumerator | name: EnumVal
88 // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo
89 // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS
90 // CHECK-NEXT: [indexEntityReference]: kind: typedef | name: MyInt
91 // CHECK-NEXT: [indexDeclaration]: kind: enum
92 // CHECK-NEXT: [indexDeclaration]: kind: enumerator | name: SecondVal
93 // CHECK-NEXT: [indexEntityReference]: kind: enumerator | name: EnumVal
95 // CHECK: [indexDeclaration]: kind: function | name: foo2
96 // CHECK: [indexEntityReference]: kind: c++-instance-method | name: operator++
97 // CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator*
98 // CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator=
99 // CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator!=
100 // CHECK-NEXT: [indexEntityReference]: kind: c++-instance-method | name: operator()
102 // CHECK: [indexEntityReference]: kind: namespace | name: NS | {{.*}} | loc: 42:17
103 // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS | {{.*}} | loc: 43:17
104 // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: Inn | {{.*}} | loc: 43:21
105 // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS | {{.*}} | loc: 44:7
106 // CHECK-NEXT: [indexEntityReference]: kind: typedef | name: Foo | {{.*}} | loc: 44:11
108 // CHECK: [indexDeclaration]: kind: c++-class-template | name: TS | {{.*}} | loc: 47:8
109 // CHECK-NEXT: [indexDeclaration]: kind: struct-template-partial-spec | name: TS | USR: c:@SP>1#T@TS>#t0.0#I | {{.*}} | loc: 50:8
110 // CHECK-NEXT: [indexDeclaration]: kind: typedef | name: MyInt | USR: c:index-refs.cpp@SP>1#T@TS>#t0.0#I@T@MyInt | {{.*}} | loc: 51:15 | semantic-container: [TS:50:8] | lexical-container: [TS:50:8]
111 // CHECK-NEXT: [indexEntityReference]: kind: c++-class-template | name: TS | USR: c:@ST>2#T#T@TS | lang: C++ | cursor: TemplateRef=TS:47:8 | loc: 50:8 | <parent>:: <<NULL>> | container: [TU] | refkind: direct | role: ref
112 /* when indexing implicit instantiations
113 [indexDeclaration]: kind: struct-template-spec | name: TS | USR: c:@S@TS>#I | {{.*}} | loc: 50:8
114 [indexDeclaration]: kind: typedef | name: MyInt | USR: c:index-refs.cpp@593@S@TS>#I@T@MyInt | {{.*}} | loc: 51:15 | semantic-container: [TS:50:8] | lexical-container: [TS:50:8]
116 // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo3
117 /* when indexing implicit instantiations
118 [indexEntityReference]: kind: struct-template-spec | name: TS | USR: c:@S@TS>#I | {{.*}} | loc: 55:3
120 // CHECK-NEXT: [indexEntityReference]: kind: struct-template-partial-spec | name: TS | USR: c:@SP>1#T@TS>#t0.0#I | {{.*}} | loc: 55:3
122 // CHECK: [indexEntityReference]: kind: variable | name: array_size | {{.*}} | loc: 59:22
123 // CHECK: [indexEntityReference]: kind: variable | name: default_param | {{.*}} | loc: 62:19 | {{.*}} | role: ref read
124 // CHECK-NOT: [indexEntityReference]: kind: variable | name: default_param | {{.*}} | loc: 62:19
126 // CHECK: [indexEntityReference]: kind: field | name: y | {{.*}} | loc: 69:20
127 // CHECK-NEXT: [indexEntityReference]: kind: field | name: x | {{.*}} | loc: 69:28
128 // CHECK-NOT: [indexEntityReference]: kind: field | name: y | {{.*}} | loc: 69:20
129 // CHECK-NOT: [indexEntityReference]: kind: field | name: x | {{.*}} | loc: 69:28
131 // CHECK: [indexEntityReference]: kind: field | name: y | {{.*}} | loc: 70:5 | {{.*}} | role: ref write
132 // CHECK: [indexEntityReference]: kind: field | name: x | {{.*}} | loc: 70:11 | {{.*}} | role: ref read
133 // CHECK: [indexEntityReference]: kind: function | name: foo3 | {{.*}} | loc: 71:10 | {{.*}} | role: ref addr
134 // CHECK: [indexEntityReference]: kind: function | name: foo4 | {{.*}} | loc: 72:3 | {{.*}} | role: ref call
136 // CHECK: [indexDeclaration]: kind: variable | name: ginitlist |
137 // CHECK: [indexEntityReference]: kind: enumerator | name: EnumVal | {{.*}} | loc: 75:20
138 // CHECK-NOT: [indexEntityReference]: kind: enumerator | name: EnumVal | {{.*}} | loc: 75:20