aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx-try.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/Parser/cxx-try.cpp')
-rw-r--r--test/Parser/cxx-try.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/Parser/cxx-try.cpp b/test/Parser/cxx-try.cpp
new file mode 100644
index 0000000000..642c8f6fe8
--- /dev/null
+++ b/test/Parser/cxx-try.cpp
@@ -0,0 +1,25 @@
+// RUN: clang -fsyntax-only -verify %s
+
+void f()
+{
+ try {
+ ;
+ } catch(int i) {
+ ;
+ } catch(...) {
+ }
+}
+
+void g()
+{
+ try; // expected-error {{expected '{'}}
+
+ try {}
+ catch; // expected-error {{expected '('}}
+
+ try {}
+ catch (...); // expected-error {{expected '{'}}
+
+ try {}
+ catch {} // expected-error {{expected '('}}
+}