Make DiagnosticErrorTrap keep a count of the errors that occurred so multiple
DiagnosticErrorTraps can be composed (e.g. a trap inside another trap).
Fixes http://llvm.org/PR10462 & rdar://9852007.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136447 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/scope-check.cpp b/test/SemaCXX/scope-check.cpp
index 3a90cc0..d656a07 100644
--- a/test/SemaCXX/scope-check.cpp
+++ b/test/SemaCXX/scope-check.cpp
@@ -171,3 +171,24 @@
}
}
}
+
+// http://llvm.org/PR10462
+namespace PR10462 {
+enum MyEnum {
+ something_valid,
+ something_invalid
+};
+
+bool recurse() {
+ MyEnum K;
+ switch (K) { // expected-warning {{enumeration value 'something_invalid' not handled in switch}}
+ case something_valid:
+ case what_am_i_thinking: // expected-error {{use of undeclared identifier}}
+ int *X = 0;
+ if (recurse()) {
+ }
+
+ break;
+ }
+}
+}