Two fixes:
1) fix a crash on test/Sema/default.c by making
sure that the switch scope is non-null.
2) if there is an error sema'ing a default or case stmt,
make sure to return the substmt up, so that the error
recovery code has more acurate info to continue with.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40134 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Sema/default.c b/test/Sema/default.c
new file mode 100644
index 0000000..e714eff
--- /dev/null
+++ b/test/Sema/default.c
@@ -0,0 +1,8 @@
+// RUN: clang -parse-ast-check %s
+
+void f5 (int z) {
+ if (z)
+ default: // expected-error {{not in switch statement}}
+ ;
+}
+