diff options
author | John McCall <rjmccall@apple.com> | 2010-03-16 05:22:47 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-03-16 05:22:47 +0000 |
commit | 58e6f34e4d2c668562e1c391162ee9de7b05fbb2 (patch) | |
tree | dcba0bf9178f1decf1c99b1ee115f0e9534d23d8 /lib/Sema/SemaDeclAttr.cpp | |
parent | 50f6af7a6d6951a63f3da7d4c5a7d3965bf73b63 (diff) |
Perform access control for the implicit base and member destructor calls
required when emitting a destructor definition.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98609 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index d369b773e8..73a34f8107 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -2038,6 +2038,8 @@ void Sema::PopParsingDeclaration(ParsingDeclStackState S, DeclPtrTy Ctx) { assert(SavedIndex <= DelayedDiagnostics.size() && "saved index is out of bounds"); + unsigned E = DelayedDiagnostics.size(); + // We only want to actually emit delayed diagnostics when we // successfully parsed a decl. Decl *D = Ctx ? Ctx.getAs<Decl>() : 0; @@ -2048,7 +2050,7 @@ void Sema::PopParsingDeclaration(ParsingDeclStackState S, DeclPtrTy Ctx) { // only the declarator pops will be passed decls. This is correct; // we really do need to consider delayed diagnostics from the decl spec // for each of the different declarations. - for (unsigned I = 0, E = DelayedDiagnostics.size(); I != E; ++I) { + for (unsigned I = 0; I != E; ++I) { if (DelayedDiagnostics[I].Triggered) continue; @@ -2064,6 +2066,10 @@ void Sema::PopParsingDeclaration(ParsingDeclStackState S, DeclPtrTy Ctx) { } } + // Destroy all the delayed diagnostics we're about to pop off. + for (unsigned I = SavedIndex; I != E; ++I) + DelayedDiagnostics[I].destroy(); + DelayedDiagnostics.set_size(SavedIndex); } |