Disallow try/catch/throw when exceptions are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126039 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCXX/no-exceptions.cpp b/test/SemaCXX/no-exceptions.cpp
index 019e25c..f739568 100644
--- a/test/SemaCXX/no-exceptions.cpp
+++ b/test/SemaCXX/no-exceptions.cpp
@@ -19,3 +19,17 @@
(void) new Foo();
}
}
+
+namespace test1 {
+void f() {
+ throw; // expected-error {{cannot use 'throw' with exceptions disabled}}
+}
+
+void g() {
+ try { // expected-error {{cannot use 'try' with exceptions disabled}}
+ f();
+ } catch (...) {
+ }
+}
+
+}