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.
llvm-svn: 40134
diff --git a/clang/test/Sema/default.c b/clang/test/Sema/default.c
new file mode 100644
index 0000000..e714eff
--- /dev/null
+++ b/clang/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}}
+ ;
+}
+