brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.1 KiB · 7731de1 Raw
56 lines · cpp
1using MyTypeAlias = int;2 3extern "C" {4  template < typename T > *Allocate() { }5}6 7namespace rdar14063074 {8template <typename T>9struct TS {};10struct TS<int> {};11 12template <typename T>13void tfoo() {}14void tfoo<int>() {}15}16 17namespace crash1 {18template<typename T> class A {19  A(A &) = delete;20  void meth();21};22template <> void A<int>::meth();23template class A<int>;24}25 26class B {27  mutable int x_;28  int y_;29 30  B() = default;31  B(int);32  explicit B(double);33  B(const B&);34  B(B&&);35};36 37class C {38  explicit C(const C&);39};40 41// RUN: c-index-test -index-file %s > %t42// RUN: FileCheck %s -input-file=%t43 44// CHECK: [indexDeclaration]: kind: type-alias | name: MyTypeAlias | {{.*}} | loc: 1:745// CHECK: [indexDeclaration]: kind: struct-template-spec | name: TS | {{.*}} | loc: 10:846// CHECK: [indexDeclaration]: kind: function-template-spec | name: tfoo | {{.*}} | loc: 14:647// CHECK: [indexDeclaration]: kind: c++-instance-method | name: meth | {{.*}} | loc: 22:2648// CHECK: [indexDeclaration]: kind: field | name: x_ | USR: c:@S@B@FI@x_ | lang: C++ | cursor: FieldDecl=x_:27:15 (Definition) (mutable) | loc: 27:15 | semantic-container: [B:26:7] | lexical-container: [B:26:7] | isRedecl: 0 | isDef: 1 | isContainer: 0 | isImplicit: 049// CHECK: [indexDeclaration]: kind: field | name: y_ | USR: c:@S@B@FI@y_ | lang: C++ | cursor: FieldDecl=y_:28:7 (Definition) | loc: 28:7 | semantic-container: [B:26:7] | lexical-container: [B:26:7] | isRedecl: 0 | isDef: 1 | isContainer: 0 | isImplicit: 050// CHECK: [indexDeclaration]: kind: constructor | name: B | {{.*}} (default constructor) (defaulted) | loc: 30:351// CHECK: [indexDeclaration]: kind: constructor | name: B | {{.*}} (converting constructor) | loc: 31:352// CHECK: [indexDeclaration]: kind: constructor | name: B | {{.*}} | loc: 32:1253// CHECK: [indexDeclaration]: kind: constructor | name: B | {{.*}} (copy constructor) (converting constructor) | loc: 33:354// CHECK: [indexDeclaration]: kind: constructor | name: B | {{.*}} (move constructor) (converting constructor) | loc: 34:355// CHECK: [indexDeclaration]: kind: constructor | name: C | {{.*}} (copy constructor) (explicit) | loc: 38:1256