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 | e99d5f30446bc6dd0c2832758860250cd8ba53e5 (patch) | |
| tree | e2d7bd3ad08444d60f50ede5adc1aeac5a80f4c3 /clang/lib/Sema | |
| parent | f9c4585c807d6f988d9a604d46c1f0967b60cea6 (diff) | |
| download | bcm5719-llvm-e99d5f30446bc6dd0c2832758860250cd8ba53e5.tar.gz bcm5719-llvm-e99d5f30446bc6dd0c2832758860250cd8ba53e5.zip | |
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.
llvm-svn: 99559
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index d449951c980..9bdcf09b296 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/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 |

