aboutsummaryrefslogtreecommitdiff
path: root/test/Parser/cxx-stmt.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-12-10 00:37:13 +0000
committerChris Lattner <sabre@nondot.org>2009-12-10 00:37:13 +0000
commit3c46a66de812238ca3c32bccfe6c3326cf96819a (patch)
tree99c959f66bdfcee65f05380f8dd3c44c0f201f7b /test/Parser/cxx-stmt.cpp
parent08d92ecf6e5b1fd23177a08c2312b58d63d863db (diff)
rename testcase
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91015 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx-stmt.cpp')
-rw-r--r--test/Parser/cxx-stmt.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/Parser/cxx-stmt.cpp b/test/Parser/cxx-stmt.cpp
new file mode 100644
index 0000000000..535f40d780
--- /dev/null
+++ b/test/Parser/cxx-stmt.cpp
@@ -0,0 +1,41 @@
+// RUN: clang-cc -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 '('}}
+}
+
+void h() try {
+} catch(...) {
+}
+
+struct A {
+ int i;
+ A(int);
+ A(char);
+ A() try : i(0) {} catch(...) {}
+ void f() try {} catch(...) {}
+ A(float) : i(0) try {} // expected-error {{expected '{' or ','}}
+};
+
+A::A(char) : i(0) try {} // expected-error {{expected '{' or ','}}
+A::A(int j) try : i(j) {} catch(...) {}