| [ |
| { |
| "directory": ".", |
| "command": "/usr/bin/clang++ -fsyntax-only t1.cpp", |
| "file": "t1.cpp" |
| }, |
| { |
| "directory": ".", |
| "command": "/usr/bin/clang++ -fsyntax-only t2.cpp -DBLAH", |
| "file": "t2.cpp" |
| }, |
| { |
| "directory": ".", |
| "command": "/usr/bin/clang++ -fsyntax-only t3.cpp -DBLAH", |
| "file": "t2.cpp" |
| } |
| ] |
| |
| // XFAIL: cygwin,mingw32,win32 |
| // RUN: c-index-test -index-compile-db %s | FileCheck %s |
| |
| // CHECK: [enteredMainFile]: t1.cpp |
| // CHECK: [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0 |
| // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1 |
| // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:9:27 |
| // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0 |
| // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 1 | isDef: 1 | isContainer: 1 |
| // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS | |
| // CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C | |
| // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:15:5 |
| // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1 |
| // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:19:5 |
| // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val1' |
| // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val2' |
| // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val3' |
| |
| // CHECK-NEXT: [enteredMainFile]: t2.cpp |
| // CHECK: [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0 |
| // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped |
| // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0 |
| // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isContainer: skipped |
| // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS | |
| // CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C | |
| // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped |
| // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo2 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: 1 |
| // CHECK-NEXT: [indexEntityReference]: kind: variable | name: some_val | {{.*}} | loc: ./t.h:25:5 |
| // CHECK-NEXT: [diagnostic]: {{.*}} undeclared identifier 'undef_val4' |
| |
| // CHECK-NEXT: [enteredMainFile]: t3.cpp |
| // CHECK: [indexDeclaration]: kind: c++-instance-method | name: method_decl | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0 |
| // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped |
| // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 0 | isDef: 0 | isContainer: 0 |
| // CHECK-NEXT: [indexDeclaration]: kind: c++-instance-method | name: method_def2 | {{.*}} | isRedecl: 1 | isDef: 1 | isContainer: skipped |
| // CHECK-NEXT: [indexEntityReference]: kind: namespace | name: NS | |
| // CHECK-NEXT: [indexEntityReference]: kind: c++-class | name: C | |
| // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo1 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped |
| // CHECK-NEXT: [indexDeclaration]: kind: function | name: foo2 | {{.*}} | isRedecl: 0 | isDef: 1 | isContainer: skipped |
| // CHECK-NOT : [diagnostic]: {{.*}} undeclared identifier |