diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-21 22:36:06 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-07-21 22:36:06 +0000 |
commit | aee31ac31696b9c956987e655dc06adb34f992df (patch) | |
tree | 8a1579aea3b3c59c2031592510cd0b035caa43f1 /clang/lib/Sema | |
parent | 83e6f9370d118ab2fb08142a2b0b1f367d6c774f (diff) | |
download | bcm5719-llvm-aee31ac31696b9c956987e655dc06adb34f992df.tar.gz bcm5719-llvm-aee31ac31696b9c956987e655dc06adb34f992df.zip |
Patch to accomodate Doug's comment on default
destruction of base/members for each destructor AST.
llvm-svn: 76663
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/Sema.h | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 11 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 6 |
3 files changed, 9 insertions, 10 deletions
diff --git a/clang/lib/Sema/Sema.h b/clang/lib/Sema/Sema.h index 47938dcd417..f13ebd3eb31 100644 --- a/clang/lib/Sema/Sema.h +++ b/clang/lib/Sema/Sema.h @@ -1463,7 +1463,7 @@ public: SourceLocation MemberLoc, IdentifierInfo &Member, DeclPtrTy ImplDecl); - virtual void ActOnDefaultCDtorInitializers(DeclPtrTy CDtorDecl); + virtual void ActOnDefaultCtorInitializers(DeclPtrTy CDtorDecl); bool ConvertArgumentsForCall(CallExpr *Call, Expr *Fn, FunctionDecl *FDecl, const FunctionProtoType *Proto, diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 989e08ee9da..4674327e6cf 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -3282,12 +3282,15 @@ Sema::DeclPtrTy Sema::ActOnFinishFunctionBody(DeclPtrTy D, StmtArg BodyArg, // Verify that that gotos and switch cases don't jump into scopes illegally. 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. + + // 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)); - + + if (CXXDestructorDecl *Destructor = dyn_cast<CXXDestructorDecl>(dcl)) + Destructor->computeBaseOrMembersToDestroy(Context); return D; } diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index cb62debfe95..1dcac3fc9ec 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -918,7 +918,7 @@ void Sema::ActOnMemInitializers(DeclPtrTy ConstructorDecl, } } -void Sema::ActOnDefaultCDtorInitializers(DeclPtrTy CDtorDecl) { +void Sema::ActOnDefaultCtorInitializers(DeclPtrTy CDtorDecl) { if (!CDtorDecl) return; @@ -926,10 +926,6 @@ void Sema::ActOnDefaultCDtorInitializers(DeclPtrTy CDtorDecl) { = dyn_cast<CXXConstructorDecl>(CDtorDecl.getAs<Decl>())) Constructor->setBaseOrMemberInitializers(Context, (CXXBaseOrMemberInitializer **)0, 0); - else - if (CXXDestructorDecl *Destructor - = dyn_cast<CXXDestructorDecl>(CDtorDecl.getAs<Decl>())) - Destructor->setBaseOrMemberDestructions(Context); } namespace { |