summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-20 23:20:59 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-20 23:20:59 +0000
commit4abc32d033eb348e615a37c61326e31860d0d185 (patch)
tree0ec671eb72a95d44a25556a3f5d03da3b2701704 /clang/test
parent9b48b856ea610a455c04b454d674d50633d54315 (diff)
downloadbcm5719-llvm-4abc32d033eb348e615a37c61326e31860d0d185.tar.gz
bcm5719-llvm-4abc32d033eb348e615a37c61326e31860d0d185.zip
Improve parser recovery when a switch condition is invalid; fixes
<rdar://problem/7971948>. llvm-svn: 104291
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Parser/switch-recovery.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/Parser/switch-recovery.cpp b/clang/test/Parser/switch-recovery.cpp
new file mode 100644
index 00000000000..8eb4cff4fbe
--- /dev/null
+++ b/clang/test/Parser/switch-recovery.cpp
@@ -0,0 +1,12 @@
+// RUN: %clang_cc1 -fsyntax-only -verify %s
+
+// <rdar://problem/7971948>
+struct A {};
+struct B {
+ void foo() {
+ switch (a) { // expected-error{{use of undeclared identifier 'a'}}
+ default:
+ return;
+ }
+ }
+};
OpenPOWER on IntegriCloud