diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-03-09 20:10:30 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-03-09 20:10:30 +0000 |
commit | 216f78b7333dbc89f58fa69066396ae3237da6da (patch) | |
tree | c5582df83664ec9d2d9c37f028dc8121124229ad /test/Index/pch-with-errors.c | |
parent | f9ff5876289d5228c299b57416a62c8c3b848287 (diff) |
Improve our semantic error recovery.
When an error made a record member invalid, the record would stay as "isBeingDefined" and
not "completeDefinition". Even easily recoverable errors ended up propagating records in
such "beingDefined" state, for example:
struct A {
~A() const; // expected-error {{'const' qualifier is not allowed on a destructor}}
};
struct B : A {}; // A & B would stay as "not complete definition" and "being defined".
This weird state was impending lookups in the records and hitting assertion in the ASTWriter.
Part of rdar://11007039
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Index/pch-with-errors.c')
-rw-r--r-- | test/Index/pch-with-errors.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/test/Index/pch-with-errors.c b/test/Index/pch-with-errors.c index d35200041c..691eab4585 100644 --- a/test/Index/pch-with-errors.c +++ b/test/Index/pch-with-errors.c @@ -5,6 +5,18 @@ void erroneous(int); void erroneous(float); +struct bar; +struct zed { + bar g; +}; +struct baz { + zed h; +}; + +struct S { + { +; + #else void foo(void) { @@ -17,8 +29,8 @@ void foo(void) { // RUN: c-index-test -test-load-source local %s -include %t.h -Xclang -detailed-preprocessing-record | FileCheck -check-prefix=CHECK-PARSE %s // RUN: c-index-test -index-file %s -include %t.h -Xclang -detailed-preprocessing-record | FileCheck -check-prefix=CHECK-INDEX %s -// CHECK-PARSE: pch-with-errors.c:10:6: FunctionDecl=foo:10:6 (Definition) Extent=[10:1 - 12:2] -// CHECK-PARSE: pch-with-errors.c:11:3: CallExpr=erroneous:5:6 Extent=[11:3 - 11:15] +// CHECK-PARSE: pch-with-errors.c:{{.*}}:6: FunctionDecl=foo +// CHECK-PARSE: pch-with-errors.c:{{.*}}:3: CallExpr=erroneous // CHECK-INDEX: [indexDeclaration]: kind: function | name: foo // CHECK-INDEX: [indexEntityReference]: kind: function | name: erroneous |