summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/exceptions.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-04-27 21:33:24 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-04-27 21:33:24 +0000
commit4c018663b22cb439de81b6bbce13fe132ae06acb (patch)
tree9136431ad2b281c9b5567fdb430ed597d4f658b4 /clang/test/SemaCXX/exceptions.cpp
parent0bc1293584cc02a83f57762098a9622f541f3b84 (diff)
downloadbcm5719-llvm-4c018663b22cb439de81b6bbce13fe132ae06acb.tar.gz
bcm5719-llvm-4c018663b22cb439de81b6bbce13fe132ae06acb.zip
Track down return statements in the handlers of a function-try-block of constructors. Meh ...
llvm-svn: 70256
Diffstat (limited to 'clang/test/SemaCXX/exceptions.cpp')
-rw-r--r--clang/test/SemaCXX/exceptions.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/exceptions.cpp b/clang/test/SemaCXX/exceptions.cpp
index 42973eba70e..5882b9cb708 100644
--- a/clang/test/SemaCXX/exceptions.cpp
+++ b/clang/test/SemaCXX/exceptions.cpp
@@ -68,3 +68,32 @@ l5:
goto l2; // expected-error {{illegal goto into protected scope}}
goto l1;
}
+
+struct BadReturn {
+ BadReturn() try {
+ } catch(...) {
+ // Try to hide
+ try {
+ } catch(...) {
+ {
+ if (0)
+ return; // expected-error {{return in the catch of a function try block of a constructor is illegal}}
+ }
+ }
+ }
+ BadReturn(int);
+};
+
+BadReturn::BadReturn(int) try {
+} catch(...) {
+ // Try to hide
+ try {
+ } catch(int) {
+ return; // expected-error {{return in the catch of a function try block of a constructor is illegal}}
+ } catch(...) {
+ {
+ if (0)
+ return; // expected-error {{return in the catch of a function try block of a constructor is illegal}}
+ }
+ }
+}
OpenPOWER on IntegriCloud