diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-04-26 20:35:05 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-04-26 20:35:05 +0000 |
commit | d3a413d3b8eb39bcee5944bc545d9997c1abe492 (patch) | |
tree | 9c84c3e5e12e5fd96b0aee7dd662e61e6d230359 /test/Parser/cxx-try.cpp | |
parent | 9a901bb63990574ff0bcc12ff851d7a71cff8ddb (diff) |
Implement function-try-blocks. However, there's a very subtle bug that I can't track down.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70155 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Parser/cxx-try.cpp')
-rw-r--r-- | test/Parser/cxx-try.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/Parser/cxx-try.cpp b/test/Parser/cxx-try.cpp index 76b85e8406..8deed35559 100644 --- a/test/Parser/cxx-try.cpp +++ b/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(...) {} |