summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/destructor.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-09-17 22:25:06 +0000
committerDouglas Gregor <dgregor@apple.com>2010-09-17 22:25:06 +0000
commit29d907de03b88da9f4222299e95ecbf3af150d8c (patch)
treed42149bc70406c10b2cfa44c952f4d8daff07b01 /clang/test/SemaCXX/destructor.cpp
parentb3e8712a1437d8eccf17e3df5efb7fb0e2f4d35b (diff)
downloadbcm5719-llvm-29d907de03b88da9f4222299e95ecbf3af150d8c.tar.gz
bcm5719-llvm-29d907de03b88da9f4222299e95ecbf3af150d8c.zip
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
Diffstat (limited to 'clang/test/SemaCXX/destructor.cpp')
-rw-r--r--clang/test/SemaCXX/destructor.cpp5
1 files changed, 3 insertions, 2 deletions
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<typename U>
void foo(T t) // expected-error{{variable has incomplete type}}
@@ -76,7 +76,8 @@ namespace PR6421 {
void disconnect()
{
T* t;
- bob<QGenericArgument>(t); // expected-error{{undeclared identifier 'bob'}}
+ bob<QGenericArgument>(t); // expected-error{{undeclared identifier 'bob'}} \
+ // expected-error{{does not refer to a value}}
}
};
}
OpenPOWER on IntegriCloud