diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-04-27 21:33:24 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2009-04-27 21:33:24 +0000 |
commit | 4c018663b22cb439de81b6bbce13fe132ae06acb (patch) | |
tree | 9136431ad2b281c9b5567fdb430ed597d4f658b4 /clang/lib/Sema/SemaDecl.cpp | |
parent | 0bc1293584cc02a83f57762098a9622f541f3b84 (diff) | |
download | bcm5719-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/lib/Sema/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 482c304603b..7549c9c69cf 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -3054,6 +3054,11 @@ Sema::DeclPtrTy Sema::ActOnFinishFunctionBody(DeclPtrTy D, StmtArg BodyArg) { if (CurFunctionNeedsScopeChecking) DiagnoseInvalidJumps(Body); + // C++ constructors that have function-try-blocks can't have return statements + // in the handlers of that block. (C++ [except.handle]p14) Verify this. + if (isa<CXXConstructorDecl>(dcl) && isa<CXXTryStmt>(Body)) + DiagnoseReturnInConstructorExceptionHandler(cast<CXXTryStmt>(Body)); + return D; } |