diff options
Diffstat (limited to 'clang/test/Parser/cxx-try.cpp')
-rw-r--r-- | clang/test/Parser/cxx-try.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-try.cpp b/clang/test/Parser/cxx-try.cpp index 76b85e84065..8deed35559c 100644 --- a/clang/test/Parser/cxx-try.cpp +++ b/clang/test/Parser/cxx-try.cpp @@ -23,3 +23,22 @@ void g() try {} catch {} // expected-error {{expected '('}} } + +void h() try { +} catch(...) { +} + +struct A { + int i; + A(float) : i(0) try {} // expected-error {{expected '{' or ','}} + A(int); + A(char); + // FIXME: There's something very strange going on here. After the first + // inline function-try-block, subsequent inline bodies aren't parsed anymore. + // Valgrind is silent, though, and I can't even debug this properly. + A() try : i(0) {} catch(...) {} + void f() try {} catch(...) {} +}; + +A::A(char) : i(0) try {} // expected-error {{expected '{' or ','}} +A::A(int j) try : i(j) {} catch(...) {} |