From 29d907de03b88da9f4222299e95ecbf3af150d8c Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Fri, 17 Sep 2010 22:25:06 +0000 Subject: When we run into an error parsing or type-checking the left-hand side of a binary expression, continue on and parse the right-hand side of the binary expression anyway, but don't call the semantic actions to type-check. Previously, we would see the error and then, effectively, skip tokens until the end of the statement. The result should be more useful recovery, both in the normal case (we'll actually see errors beyond the first one in a statement), but it also helps code completion do a much better job, because we do "real" code completion on the right-hand side of an invalid binary expression rather than completing with the recovery completion. For example, given x = p->y if there is no variable named "x", we can still complete after the p-> as a member expression. Along the recovery path, we would have completed after the "->" as if we were in an expression context, which is mostly useless. llvm-svn: 114225 --- clang/test/SemaCXX/destructor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'clang/test/SemaCXX/destructor.cpp') diff --git a/clang/test/SemaCXX/destructor.cpp b/clang/test/SemaCXX/destructor.cpp index cdcae2e4119..a33aa5e05e5 100644 --- a/clang/test/SemaCXX/destructor.cpp +++ b/clang/test/SemaCXX/destructor.cpp @@ -67,7 +67,7 @@ struct Y { namespace PR6421 { class T; // expected-note{{forward declaration}} - class QGenericArgument + class QGenericArgument // expected-note{{declared here}} { template void foo(T t) // expected-error{{variable has incomplete type}} @@ -76,7 +76,8 @@ namespace PR6421 { void disconnect() { T* t; - bob(t); // expected-error{{undeclared identifier 'bob'}} + bob(t); // expected-error{{undeclared identifier 'bob'}} \ + // expected-error{{does not refer to a value}} } }; } -- cgit v1.2.3