diff options
author | John McCall <rjmccall@apple.com> | 2010-03-25 22:08:03 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-03-25 22:08:03 +0000 |
commit | 90f97892eb8b2ecfcf633c9df01e2504686d4d96 (patch) | |
tree | 11ad57ae7fb50fd6ef16340faa386cd7ec4ca719 /lib/Sema/SemaDecl.cpp | |
parent | 1b23fe61cf4437668280212d0ad6cb7196f51529 (diff) |
When finishing a function definition, leave the function definition *after*
doing all the cleanup tasks and checks. This gives us the proper context for
checking access to base and member destructors.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99559 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDecl.cpp')
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index d449951c98..9bdcf09b29 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -4336,8 +4336,6 @@ Sema::DeclPtrTy Sema::ActOnFinishFunctionBody(DeclPtrTy D, StmtArg BodyArg, Body->Destroy(Context); return DeclPtrTy(); } - if (!IsInstantiation) - PopDeclContext(); // Verify and clean out per-function state. @@ -4419,6 +4417,9 @@ Sema::DeclPtrTy Sema::ActOnFinishFunctionBody(DeclPtrTy D, StmtArg BodyArg, assert(ExprTemporaries.empty() && "Leftover temporaries in function"); } + if (!IsInstantiation) + PopDeclContext(); + PopFunctionOrBlockScope(); // If any errors have occurred, clear out any temporaries that may have |