115417cfaSDouglas Gregor // Test is line- and column-sensitive. Run lines are below.
215417cfaSDouglas Gregor
315417cfaSDouglas Gregor struct X {
415417cfaSDouglas Gregor X();
515417cfaSDouglas Gregor X(int);
615417cfaSDouglas Gregor X(int, int);
715417cfaSDouglas Gregor X(const X&);
815417cfaSDouglas Gregor };
915417cfaSDouglas Gregor
getX(int value)1015417cfaSDouglas Gregor X getX(int value) {
1115417cfaSDouglas Gregor switch (value) {
1215417cfaSDouglas Gregor case 1: return X(value);
1315417cfaSDouglas Gregor case 2: return X(value, value);
1415417cfaSDouglas Gregor case 3: return (X)value;
1515417cfaSDouglas Gregor default: break;
1615417cfaSDouglas Gregor }
1715417cfaSDouglas Gregor return X();
1815417cfaSDouglas Gregor }
1915417cfaSDouglas Gregor
2030313cbbSDouglas Gregor struct Y {
2130313cbbSDouglas Gregor int member;
2230313cbbSDouglas Gregor
2330313cbbSDouglas Gregor X getX();
2430313cbbSDouglas Gregor };
2530313cbbSDouglas Gregor
getX()2630313cbbSDouglas Gregor X Y::getX() {
2730313cbbSDouglas Gregor return member;
2830313cbbSDouglas Gregor }
2930313cbbSDouglas Gregor
3030313cbbSDouglas Gregor struct YDerived : Y {
getAnotherXYDerived3130313cbbSDouglas Gregor X getAnotherX() { return member; }
3230313cbbSDouglas Gregor };
3330313cbbSDouglas Gregor
test()34d289104eSArgyrios Kyrtzidis void test() {
35d289104eSArgyrios Kyrtzidis X foo;
360fd8fae0SArgyrios Kyrtzidis
370fd8fae0SArgyrios Kyrtzidis try {
380fd8fae0SArgyrios Kyrtzidis } catch (X e) {
390fd8fae0SArgyrios Kyrtzidis X x;
400fd8fae0SArgyrios Kyrtzidis }
41fbb2bb5aSArgyrios Kyrtzidis
42fbb2bb5aSArgyrios Kyrtzidis struct LocalS {
43fbb2bb5aSArgyrios Kyrtzidis void meth() {
44fbb2bb5aSArgyrios Kyrtzidis int x;
45fbb2bb5aSArgyrios Kyrtzidis ++x;
46fbb2bb5aSArgyrios Kyrtzidis }
47fbb2bb5aSArgyrios Kyrtzidis };
48d289104eSArgyrios Kyrtzidis }
49d289104eSArgyrios Kyrtzidis
502ec76747SArgyrios Kyrtzidis template <bool (*tfn)(X*)>
512ec76747SArgyrios Kyrtzidis struct TS {
522ec76747SArgyrios Kyrtzidis void foo();
532ec76747SArgyrios Kyrtzidis };
542ec76747SArgyrios Kyrtzidis
552ec76747SArgyrios Kyrtzidis template <bool (*tfn)(X*)>
foo()562ec76747SArgyrios Kyrtzidis void TS<tfn>::foo() {}
572ec76747SArgyrios Kyrtzidis
5840bcfd71SArgyrios Kyrtzidis template <typename T>
5940bcfd71SArgyrios Kyrtzidis class TC {
6040bcfd71SArgyrios Kyrtzidis void init();
6140bcfd71SArgyrios Kyrtzidis };
6240bcfd71SArgyrios Kyrtzidis
6340bcfd71SArgyrios Kyrtzidis template<> void TC<char>::init();
6440bcfd71SArgyrios Kyrtzidis
6540bcfd71SArgyrios Kyrtzidis #define EXTERN_TEMPLATE(...) extern template __VA_ARGS__;
6640bcfd71SArgyrios Kyrtzidis EXTERN_TEMPLATE(class TC<char>)
6740bcfd71SArgyrios Kyrtzidis
68a2a1e530SArgyrios Kyrtzidis class A {
69a2a1e530SArgyrios Kyrtzidis A();
70a2a1e530SArgyrios Kyrtzidis virtual ~A();
71a2a1e530SArgyrios Kyrtzidis
72a2a1e530SArgyrios Kyrtzidis // Assignment operators
73a2a1e530SArgyrios Kyrtzidis A& operator=(const A&);
74a2a1e530SArgyrios Kyrtzidis A& operator=(A&&) noexcept;
75a2a1e530SArgyrios Kyrtzidis
76a2a1e530SArgyrios Kyrtzidis // Unary operators
77a2a1e530SArgyrios Kyrtzidis A operator+() const;
78a2a1e530SArgyrios Kyrtzidis A operator-() const;
79a2a1e530SArgyrios Kyrtzidis A operator~() const;
80a2a1e530SArgyrios Kyrtzidis A operator*() const;
81a2a1e530SArgyrios Kyrtzidis A operator&() const;
82a2a1e530SArgyrios Kyrtzidis bool operator!() const;
83a2a1e530SArgyrios Kyrtzidis
84a2a1e530SArgyrios Kyrtzidis // (pre-|post-) increment and decrement
85a2a1e530SArgyrios Kyrtzidis A& operator++();
86a2a1e530SArgyrios Kyrtzidis A& operator--();
87a2a1e530SArgyrios Kyrtzidis A operator++(int);
88a2a1e530SArgyrios Kyrtzidis A operator--(int);
89a2a1e530SArgyrios Kyrtzidis
90a2a1e530SArgyrios Kyrtzidis // Arithmetic operators
91a2a1e530SArgyrios Kyrtzidis A operator+(const A&) const;
92a2a1e530SArgyrios Kyrtzidis A operator-(const A&) const;
93a2a1e530SArgyrios Kyrtzidis A operator*(const A&) const;
94a2a1e530SArgyrios Kyrtzidis A operator/(const A&) const;
95a2a1e530SArgyrios Kyrtzidis A operator%(const A&) const;
96a2a1e530SArgyrios Kyrtzidis A operator&(const A&) const;
97a2a1e530SArgyrios Kyrtzidis A operator|(const A&) const;
98a2a1e530SArgyrios Kyrtzidis A operator^(const A&) const;
99a2a1e530SArgyrios Kyrtzidis
100a2a1e530SArgyrios Kyrtzidis A operator<<(const A&) const;
101a2a1e530SArgyrios Kyrtzidis A operator>>(const A&) const;
102a2a1e530SArgyrios Kyrtzidis
103a2a1e530SArgyrios Kyrtzidis // Arithmetic-assignment operators
104a2a1e530SArgyrios Kyrtzidis A& operator+=(const A&);
105a2a1e530SArgyrios Kyrtzidis A& operator-=(const A&);
106a2a1e530SArgyrios Kyrtzidis A& operator*=(const A&);
107a2a1e530SArgyrios Kyrtzidis A& operator/=(const A&);
108a2a1e530SArgyrios Kyrtzidis A& operator%=(const A&);
109a2a1e530SArgyrios Kyrtzidis A& operator&=(const A&);
110a2a1e530SArgyrios Kyrtzidis A& operator|=(const A&);
111a2a1e530SArgyrios Kyrtzidis A& operator^=(const A&);
112a2a1e530SArgyrios Kyrtzidis
113a2a1e530SArgyrios Kyrtzidis A& operator<<=(const A&);
114a2a1e530SArgyrios Kyrtzidis A& operator>>=(const A&);
115a2a1e530SArgyrios Kyrtzidis
116a2a1e530SArgyrios Kyrtzidis // Logical operators
117a2a1e530SArgyrios Kyrtzidis bool operator<(const A&) const;
118a2a1e530SArgyrios Kyrtzidis bool operator>(const A&) const;
119a2a1e530SArgyrios Kyrtzidis
120a2a1e530SArgyrios Kyrtzidis bool operator&&(const A&) const;
121a2a1e530SArgyrios Kyrtzidis bool operator||(const A&) const;
122a2a1e530SArgyrios Kyrtzidis bool operator<=(const A&) const;
123a2a1e530SArgyrios Kyrtzidis bool operator>=(const A&) const;
124a2a1e530SArgyrios Kyrtzidis bool operator!=(const A&) const;
125a2a1e530SArgyrios Kyrtzidis bool operator==(const A&) const;
126a2a1e530SArgyrios Kyrtzidis
127a2a1e530SArgyrios Kyrtzidis // Special operators
128a2a1e530SArgyrios Kyrtzidis A& operator[](unsigned long long);
129a2a1e530SArgyrios Kyrtzidis A* operator->();
130a2a1e530SArgyrios Kyrtzidis A operator()(unsigned, int) const;
131a2a1e530SArgyrios Kyrtzidis
132a2a1e530SArgyrios Kyrtzidis explicit operator bool() const;
133a2a1e530SArgyrios Kyrtzidis };
134a2a1e530SArgyrios Kyrtzidis
13599891245SArgyrios Kyrtzidis struct TestColl {
13699891245SArgyrios Kyrtzidis int* begin();
13799891245SArgyrios Kyrtzidis int* end();
13899891245SArgyrios Kyrtzidis };
13999891245SArgyrios Kyrtzidis
test(TestColl coll)14099891245SArgyrios Kyrtzidis void test(TestColl coll) {
141cde7069cSArgyrios Kyrtzidis for (auto lv : coll) {
142cde7069cSArgyrios Kyrtzidis (void)lv;
143cde7069cSArgyrios Kyrtzidis }
14499891245SArgyrios Kyrtzidis }
14599891245SArgyrios Kyrtzidis
operator ""_toint(unsigned long long val)1464be5d674SKevin Funk const int operator""_toint(unsigned long long val) { return int(val); }
1474be5d674SKevin Funk
1480a5b03b6SJonathan Coe // noexcept specifications
1490a5b03b6SJonathan Coe void f_noexcept() noexcept;
1500a5b03b6SJonathan Coe template <class T> void f_computed_noexcept(T t) noexcept(noexcept(t+t));
1510a5b03b6SJonathan Coe void f_dynamic_noexcept_none() throw();
1520a5b03b6SJonathan Coe void f_dynamic_noexcept() throw(int);
1530a5b03b6SJonathan Coe void f_dynamic_noexcept_any() throw(...);
154*eedb0c95SRichard Smith void f_computed_noexcept_true() noexcept(true);
155*eedb0c95SRichard Smith void f_computed_noexcept_false() noexcept(false);
1560a5b03b6SJonathan Coe
15799f9759dSBenjamin Kramer enum EnumType { Enumerator };
15899f9759dSBenjamin Kramer struct Z {
15999f9759dSBenjamin Kramer EnumType e = Enumerator;
16099f9759dSBenjamin Kramer };
16199f9759dSBenjamin Kramer
1626c483597SErich Keane // RUN: c-index-test -cursor-at=%s:6:4 %s | FileCheck -check-prefix=CHECK-COMPLETION-1 %s
1633f35bb2dSDouglas Gregor // CHECK-COMPLETION-1: CXXConstructor=X:6:3
1643f35bb2dSDouglas Gregor // CHECK-COMPLETION-1-NEXT: Completion string: {TypedText X}{LeftParen (}{Placeholder int}{Comma , }{Placeholder int}{RightParen )}
1653f35bb2dSDouglas Gregor
1666c483597SErich Keane // RUN: c-index-test -cursor-at=%s:31:16 %s | FileCheck -check-prefix=CHECK-COMPLETION-2 %s
1673f35bb2dSDouglas Gregor // CHECK-COMPLETION-2: CXXMethod=getAnotherX:31:5 (Definition)
1683f35bb2dSDouglas Gregor // CHECK-COMPLETION-2-NEXT: Completion string: {ResultType X}{TypedText getAnotherX}{LeftParen (}{RightParen )}
1693f35bb2dSDouglas Gregor
1706c483597SErich Keane // RUN: c-index-test -cursor-at=%s:12:20 %s | FileCheck -check-prefix=CHECK-VALUE-REF %s
1716c483597SErich Keane // RUN: c-index-test -cursor-at=%s:13:21 %s | FileCheck -check-prefix=CHECK-VALUE-REF %s
1726c483597SErich Keane // RUN: c-index-test -cursor-at=%s:13:28 %s | FileCheck -check-prefix=CHECK-VALUE-REF %s
1736c483597SErich Keane // RUN: c-index-test -cursor-at=%s:14:23 %s | FileCheck -check-prefix=CHECK-VALUE-REF %s
17415417cfaSDouglas Gregor // CHECK-VALUE-REF: DeclRefExpr=value:10:12
17515417cfaSDouglas Gregor
1766c483597SErich Keane // RUN: c-index-test -cursor-at=%s:12:18 %s | FileCheck -check-prefix=CHECK-CONSTRUCTOR1 %s
1776c483597SErich Keane // RUN: c-index-test -cursor-at=%s:13:18 %s | FileCheck -check-prefix=CHECK-CONSTRUCTOR2 %s
1786c483597SErich Keane // RUN: c-index-test -cursor-at=%s:14:19 %s | FileCheck -check-prefix=CHECK-CONSTRUCTOR1 %s
1796c483597SErich Keane // RUN: c-index-test -cursor-at=%s:17:10 %s | FileCheck -check-prefix=CHECK-CONSTRUCTOR3 %s
18015417cfaSDouglas Gregor // CHECK-TYPE-REF: TypeRef=struct X:3:8
18116443fddSDouglas Gregor // CHECK-CONSTRUCTOR1: CallExpr=X:5:3
18216443fddSDouglas Gregor // CHECK-CONSTRUCTOR2: CallExpr=X:6:3
18316443fddSDouglas Gregor // CHECK-CONSTRUCTOR3: CallExpr=X:4:3
18430313cbbSDouglas Gregor
1856c483597SErich Keane // RUN: c-index-test -cursor-at=%s:23:3 %s | FileCheck -check-prefix=CHECK-RETTYPE %s
1866c483597SErich Keane // RUN: c-index-test -cursor-at=%s:26:1 %s | FileCheck -check-prefix=CHECK-RETTYPE %s
18730313cbbSDouglas Gregor // CHECK-RETTYPE: TypeRef=struct X:3:8
18830313cbbSDouglas Gregor
1896c483597SErich Keane // RUN: c-index-test -cursor-at=%s:23:7 %s | FileCheck -check-prefix=CHECK-MEMFUNC-DECL %s
19030313cbbSDouglas Gregor // CHECK-MEMFUNC-DECL: CXXMethod=getX:23:5
1916c483597SErich Keane // RUN: c-index-test -cursor-at=%s:26:7 %s | FileCheck -check-prefix=CHECK-MEMFUNC-DEF %s
19230313cbbSDouglas Gregor // CHECK-MEMFUNC-DEF: CXXMethod=getX:26:6
19330313cbbSDouglas Gregor
1946c483597SErich Keane // RUN: c-index-test -cursor-at=%s:26:3 %s | FileCheck -check-prefix=CHECK-TYPEREF-Y %s
19530313cbbSDouglas Gregor // CHECK-TYPEREF-Y: TypeRef=struct Y:20:8
19630313cbbSDouglas Gregor
1976c483597SErich Keane // RUN: c-index-test -cursor-at=%s:27:10 %s | FileCheck -check-prefix=CHECK-IMPLICIT-MEMREF %s
1986c483597SErich Keane // RUN: c-index-test -cursor-at=%s:31:28 %s | FileCheck -check-prefix=CHECK-IMPLICIT-MEMREF %s
19930313cbbSDouglas Gregor // CHECK-IMPLICIT-MEMREF: MemberRefExpr=member:21:7
200d289104eSArgyrios Kyrtzidis
2016c483597SErich Keane // RUN: c-index-test -cursor-at=%s:35:5 %s | FileCheck -check-prefix=CHECK-DECL %s
202d289104eSArgyrios Kyrtzidis // CHECK-DECL: VarDecl=foo:35:5
2033f35bb2dSDouglas Gregor
2046c483597SErich Keane // RUN: c-index-test -cursor-at=%s:21:3 %s | FileCheck -check-prefix=CHECK-MEMBER %s
2053f35bb2dSDouglas Gregor // CHECK-MEMBER: FieldDecl=member:21:7 (Definition)
2063f35bb2dSDouglas Gregor // CHECK-MEMBER-NEXT: Completion string: {ResultType int}{TypedText member}
2070fd8fae0SArgyrios Kyrtzidis
2086c483597SErich Keane // RUN: c-index-test -cursor-at=%s:38:12 -cursor-at=%s:39:5 %s | FileCheck -check-prefix=CHECK-CXXCATCH %s
2090fd8fae0SArgyrios Kyrtzidis // CHECK-CXXCATCH: TypeRef=struct X:3:8
2100fd8fae0SArgyrios Kyrtzidis // CHECK-CXXCATCH-NEXT: TypeRef=struct X:3:8
2110042b6f9SArgyrios Kyrtzidis
2126c483597SErich Keane // RUN: c-index-test -test-load-source-usrs local %s | FileCheck -check-prefix=CHECK-USR %s
2130042b6f9SArgyrios Kyrtzidis // CHECK-USR: get-cursor.cpp c:get-cursor.cpp@472@F@test#@e Extent=[38:12 - 38:15]
2140042b6f9SArgyrios Kyrtzidis // CHECK-USR: get-cursor.cpp c:get-cursor.cpp@483@F@test#@x Extent=[39:5 - 39:8]
215fbb2bb5aSArgyrios Kyrtzidis
2166c483597SErich Keane // RUN: c-index-test -cursor-at=%s:45:9 %s | FileCheck -check-prefix=CHECK-LOCALCLASS %s
217fbb2bb5aSArgyrios Kyrtzidis // CHECK-LOCALCLASS: 45:9 DeclRefExpr=x:44:11 Extent=[45:9 - 45:10] Spelling=x ([45:9 - 45:10])
2182ec76747SArgyrios Kyrtzidis
2196c483597SErich Keane // RUN: c-index-test -cursor-at=%s:50:23 -cursor-at=%s:55:23 %s | FileCheck -check-prefix=CHECK-TEMPLPARAM %s
2202ec76747SArgyrios Kyrtzidis // CHECK-TEMPLPARAM: 50:23 TypeRef=struct X:3:8 Extent=[50:23 - 50:24] Spelling=struct X ([50:23 - 50:24])
2212ec76747SArgyrios Kyrtzidis // CHECK-TEMPLPARAM: 55:23 TypeRef=struct X:3:8 Extent=[55:23 - 55:24] Spelling=struct X ([55:23 - 55:24])
22240bcfd71SArgyrios Kyrtzidis
2236c483597SErich Keane // RUN: c-index-test -cursor-at=%s:66:23 %s | FileCheck -check-prefix=CHECK-TEMPLSPEC %s
22440bcfd71SArgyrios Kyrtzidis // CHECK-TEMPLSPEC: 66:23 ClassDecl=TC:66:23 (Definition) [Specialization of TC:59:7] Extent=[66:1 - 66:31] Spelling=TC ([66:23 - 66:25])
225a2a1e530SArgyrios Kyrtzidis
226*eedb0c95SRichard Smith // RUN: c-index-test -cursor-at=%s:69:3 -cursor-at=%s:70:11 -cursor-at=%s:73:6 -cursor-at=%s:74:6 -cursor-at=%s:77:8 -cursor-at=%s:78:8 -cursor-at=%s:79:8 -cursor-at=%s:80:8 -cursor-at=%s:81:8 -cursor-at=%s:82:8 -cursor-at=%s:85:6 -cursor-at=%s:86:6 -cursor-at=%s:87:6 -cursor-at=%s:88:6 -cursor-at=%s:91:5 -cursor-at=%s:92:5 -cursor-at=%s:93:5 -cursor-at=%s:94:5 -cursor-at=%s:95:5 -cursor-at=%s:96:5 -cursor-at=%s:97:5 -cursor-at=%s:98:5 -cursor-at=%s:100:5 -cursor-at=%s:101:5 -cursor-at=%s:104:6 -cursor-at=%s:105:6 -cursor-at=%s:106:6 -cursor-at=%s:107:6 -cursor-at=%s:108:6 -cursor-at=%s:109:6 -cursor-at=%s:110:6 -cursor-at=%s:111:6 -cursor-at=%s:113:6 -cursor-at=%s:114:6 -cursor-at=%s:117:8 -cursor-at=%s:118:8 -cursor-at=%s:120:8 -cursor-at=%s:121:8 -cursor-at=%s:122:8 -cursor-at=%s:123:8 -cursor-at=%s:124:8 -cursor-at=%s:125:8 -cursor-at=%s:128:6 -cursor-at=%s:129:6 -cursor-at=%s:130:6 -cursor-at=%s:132:3 -cursor-at=%s:146:15 -cursor-at=%s:149:6 -cursor-at=%s:150:25 -cursor-at=%s:151:6 -cursor-at=%s:152:6 -cursor-at=%s:153:6 -cursor-at=%s:154:6 -cursor-at=%s:155:6 -std=c++11 %s | FileCheck -check-prefix=CHECK-SPELLING %s
2272956535bSJonathan Coe // CHECK-SPELLING: 69:3 CXXConstructor=A:69:3 (default constructor) Extent=[69:3 - 69:6] Spelling=A ([69:3 - 69:4])
228a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 70:11 CXXDestructor=~A:70:11 (virtual) Extent=[70:3 - 70:15] Spelling=~A ([70:11 - 70:13])
229a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 73:6 CXXMethod=operator=:73:6 Extent=[73:3 - 73:25] Spelling=operator= ([73:6 - 73:15])
2300a5b03b6SJonathan Coe // CHECK-SPELLING: 74:6 CXXMethod=operator=:74:6 (noexcept) Extent=[74:3 - 74:29] Spelling=operator= ([74:6 - 74:15])
231a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 77:8 CXXMethod=operator+:77:8 (const) Extent=[77:3 - 77:25] Spelling=operator+ ([77:8 - 77:17])
232a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 78:8 CXXMethod=operator-:78:8 (const) Extent=[78:3 - 78:25] Spelling=operator- ([78:8 - 78:17])
233a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 79:8 CXXMethod=operator~:79:8 (const) Extent=[79:3 - 79:25] Spelling=operator~ ([79:8 - 79:17])
234a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 80:8 CXXMethod=operator*:80:8 (const) Extent=[80:3 - 80:25] Spelling=operator* ([80:8 - 80:17])
235a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 81:8 CXXMethod=operator&:81:8 (const) Extent=[81:3 - 81:25] Spelling=operator& ([81:8 - 81:17])
236a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 82:8 CXXMethod=operator!:82:8 (const) Extent=[82:3 - 82:25] Spelling=operator! ([82:8 - 82:17])
237a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 85:6 CXXMethod=operator++:85:6 Extent=[85:3 - 85:18] Spelling=operator++ ([85:6 - 85:16])
238a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 86:6 CXXMethod=operator--:86:6 Extent=[86:3 - 86:18] Spelling=operator-- ([86:6 - 86:16])
239a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 87:6 CXXMethod=operator++:87:6 Extent=[87:3 - 87:21] Spelling=operator++ ([87:6 - 87:16])
240a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 88:6 CXXMethod=operator--:88:6 Extent=[88:3 - 88:21] Spelling=operator-- ([88:6 - 88:16])
241a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 91:5 CXXMethod=operator+:91:5 (const) Extent=[91:3 - 91:30] Spelling=operator+ ([91:5 - 91:14])
242a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 92:5 CXXMethod=operator-:92:5 (const) Extent=[92:3 - 92:30] Spelling=operator- ([92:5 - 92:14])
243a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 93:5 CXXMethod=operator*:93:5 (const) Extent=[93:3 - 93:30] Spelling=operator* ([93:5 - 93:14])
244a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 94:5 CXXMethod=operator/:94:5 (const) Extent=[94:3 - 94:30] Spelling=operator/ ([94:5 - 94:14])
245a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 95:5 CXXMethod=operator%:95:5 (const) Extent=[95:3 - 95:30] Spelling=operator% ([95:5 - 95:14])
246a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 96:5 CXXMethod=operator&:96:5 (const) Extent=[96:3 - 96:30] Spelling=operator& ([96:5 - 96:14])
247a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 97:5 CXXMethod=operator|:97:5 (const) Extent=[97:3 - 97:30] Spelling=operator| ([97:5 - 97:14])
248a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 98:5 CXXMethod=operator^:98:5 (const) Extent=[98:3 - 98:30] Spelling=operator^ ([98:5 - 98:14])
249a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 100:5 CXXMethod=operator<<:100:5 (const) Extent=[100:3 - 100:31] Spelling=operator<< ([100:5 - 100:15])
250a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 101:5 CXXMethod=operator>>:101:5 (const) Extent=[101:3 - 101:31] Spelling=operator>> ([101:5 - 101:15])
251a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 104:6 CXXMethod=operator+=:104:6 Extent=[104:3 - 104:26] Spelling=operator+= ([104:6 - 104:16])
252a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 105:6 CXXMethod=operator-=:105:6 Extent=[105:3 - 105:26] Spelling=operator-= ([105:6 - 105:16])
253a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 106:6 CXXMethod=operator*=:106:6 Extent=[106:3 - 106:26] Spelling=operator*= ([106:6 - 106:16])
254a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 107:6 CXXMethod=operator/=:107:6 Extent=[107:3 - 107:26] Spelling=operator/= ([107:6 - 107:16])
255a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 108:6 CXXMethod=operator%=:108:6 Extent=[108:3 - 108:26] Spelling=operator%= ([108:6 - 108:16])
256a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 109:6 CXXMethod=operator&=:109:6 Extent=[109:3 - 109:26] Spelling=operator&= ([109:6 - 109:16])
257a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 110:6 CXXMethod=operator|=:110:6 Extent=[110:3 - 110:26] Spelling=operator|= ([110:6 - 110:16])
258a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 111:6 CXXMethod=operator^=:111:6 Extent=[111:3 - 111:26] Spelling=operator^= ([111:6 - 111:16])
259a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 113:6 CXXMethod=operator<<=:113:6 Extent=[113:3 - 113:27] Spelling=operator<<= ([113:6 - 113:17])
260a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 114:6 CXXMethod=operator>>=:114:6 Extent=[114:3 - 114:27] Spelling=operator>>= ([114:6 - 114:17])
261a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 117:8 CXXMethod=operator<:117:8 (const) Extent=[117:3 - 117:33] Spelling=operator< ([117:8 - 117:17])
262a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 118:8 CXXMethod=operator>:118:8 (const) Extent=[118:3 - 118:33] Spelling=operator> ([118:8 - 118:17])
263a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 120:8 CXXMethod=operator&&:120:8 (const) Extent=[120:3 - 120:34] Spelling=operator&& ([120:8 - 120:18])
264a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 121:8 CXXMethod=operator||:121:8 (const) Extent=[121:3 - 121:34] Spelling=operator|| ([121:8 - 121:18])
265a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 122:8 CXXMethod=operator<=:122:8 (const) Extent=[122:3 - 122:34] Spelling=operator<= ([122:8 - 122:18])
266a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 123:8 CXXMethod=operator>=:123:8 (const) Extent=[123:3 - 123:34] Spelling=operator>= ([123:8 - 123:18])
267a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 124:8 CXXMethod=operator!=:124:8 (const) Extent=[124:3 - 124:34] Spelling=operator!= ([124:8 - 124:18])
268a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 125:8 CXXMethod=operator==:125:8 (const) Extent=[125:3 - 125:34] Spelling=operator== ([125:8 - 125:18])
269a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 128:6 CXXMethod=operator[]:128:6 Extent=[128:3 - 128:36] Spelling=operator[] ([128:6 - 128:16])
270a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 129:6 CXXMethod=operator->:129:6 Extent=[129:3 - 129:18] Spelling=operator-> ([129:6 - 129:16])
271a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 130:6 CXXMethod=operator():130:6 (const) Extent=[130:3 - 130:37] Spelling=operator() ([130:6 - 130:16])
272a2a1e530SArgyrios Kyrtzidis // CHECK-SPELLING: 132:12 CXXConversion=operator bool:132:12 (const) Extent=[132:3 - 132:33] Spelling=operator bool ([132:12 - 132:25])
2734be5d674SKevin Funk // CHECK-SPELLING: 146:11 FunctionDecl=operator""_toint:146:11 (Definition) Extent=[146:1 - 146:72] Spelling=operator""_toint ([146:11 - 146:27])
2740a5b03b6SJonathan Coe // CHECK-SPELLING: 149:6 FunctionDecl=f_noexcept:149:6 (noexcept) Extent=[149:1 - 149:27] Spelling=f_noexcept ([149:6 - 149:16])
2750a5b03b6SJonathan Coe // CHECK-SPELLING: 150:25 FunctionTemplate=f_computed_noexcept:150:25 (computed-noexcept) Extent=[150:1 - 150:73] Spelling=f_computed_noexcept ([150:25 - 150:44])
2760a5b03b6SJonathan Coe // CHECK-SPELLING: 151:6 FunctionDecl=f_dynamic_noexcept_none:151:6 (noexcept dynamic none) Extent=[151:1 - 151:39] Spelling=f_dynamic_noexcept_none ([151:6 - 151:29])
2770a5b03b6SJonathan Coe // CHECK-SPELLING: 152:6 FunctionDecl=f_dynamic_noexcept:152:6 (noexcept dynamic) Extent=[152:1 - 152:37] Spelling=f_dynamic_noexcept ([152:6 - 152:24])
2780a5b03b6SJonathan Coe // CHECK-SPELLING: 153:6 FunctionDecl=f_dynamic_noexcept_any:153:6 (noexcept dynamic any) Extent=[153:1 - 153:41] Spelling=f_dynamic_noexcept_any ([153:6 - 153:28])
279*eedb0c95SRichard Smith // CHECK-SPELLING: 154:6 FunctionDecl=f_computed_noexcept_true:154:6 (computed-noexcept) Extent=[154:1 - 154:47] Spelling=f_computed_noexcept_true ([154:6 - 154:30])
280*eedb0c95SRichard Smith // CHECK-SPELLING: 155:6 FunctionDecl=f_computed_noexcept_false:155:6 (computed-noexcept) Extent=[155:1 - 155:49] Spelling=f_computed_noexcept_false ([155:6 - 155:31])
28199891245SArgyrios Kyrtzidis
2826c483597SErich Keane // RUN: c-index-test -cursor-at=%s:141:13 -cursor-at=%s:141:18 -cursor-at=%s:142:11 -std=c++11 %s | FileCheck -check-prefix=CHECK-FORRANGE %s
28399891245SArgyrios Kyrtzidis // CHECK-FORRANGE: 141:13 VarDecl=lv:141:13 (Definition) Extent=[141:8 - 141:17] Spelling=lv ([141:13 - 141:15])
28499891245SArgyrios Kyrtzidis // CHECK-FORRANGE: 141:18 DeclRefExpr=coll:140:20 Extent=[141:18 - 141:22] Spelling=coll ([141:18 - 141:22])
285cde7069cSArgyrios Kyrtzidis // CHECK-FORRANGE: 142:11 DeclRefExpr=lv:141:13 Extent=[142:11 - 142:13] Spelling=lv ([142:11 - 142:13])
2860a5b03b6SJonathan Coe
287*eedb0c95SRichard Smith // RUN: c-index-test -cursor-at=%s:159:18 -std=c++11 %s | FileCheck -check-prefix=CHECK-INCLASSINITIALIZER %s
288*eedb0c95SRichard Smith // CHECK-INCLASSINITIALIZER: 159:18 DeclRefExpr=Enumerator:157:17 Extent=[159:18 - 159:28] Spelling=Enumerator ([159:18 - 159:28])
28999f9759dSBenjamin Kramer
290