diff options
author | John McCall <rjmccall@apple.com> | 2012-04-09 21:51:56 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2012-04-09 21:51:56 +0000 |
commit | dd1eca34b52d7c9239c59e85ecb372051634bc1e (patch) | |
tree | 95c34d2787313a0f81879987fcc0326518d85ec9 /clang/lib/Sema | |
parent | d42742143c13cd1aca95f659bedb4a3bc8c7f76b (diff) | |
download | bcm5719-llvm-dd1eca34b52d7c9239c59e85ecb372051634bc1e.tar.gz bcm5719-llvm-dd1eca34b52d7c9239c59e85ecb372051634bc1e.zip |
My original patch missed the virtual-base case for destroying
base-class subojects.
Incidentally, thinking about virtual bases makes it clear to me that
we're not appropriately computing the access to the virtual base's
member because we're not computing the best possible access to the
virtual base at all; in fact, we're basically assuming it's public.
I'll file a separate PR about that.
llvm-svn: 154346
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 704ff834b46..847f03c948a 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -3356,7 +3356,7 @@ Sema::MarkBaseAndMemberDestructorsReferenced(SourceLocation Location, E = ClassDecl->vbases_end(); VBase != E; ++VBase) { // Bases are always records in a well-formed non-dependent class. - const RecordType *RT = VBase->getType()->getAs<RecordType>(); + const RecordType *RT = VBase->getType()->castAs<RecordType>(); // Ignore direct virtual bases. if (DirectVirtualBases.count(RT)) @@ -3373,7 +3373,8 @@ Sema::MarkBaseAndMemberDestructorsReferenced(SourceLocation Location, assert(Dtor && "No dtor found for BaseClassDecl!"); CheckDestructorAccess(ClassDecl->getLocation(), Dtor, PDiag(diag::err_access_dtor_vbase) - << VBase->getType()); + << VBase->getType(), + Context.getTypeDeclType(ClassDecl)); MarkFunctionReferenced(Location, const_cast<CXXDestructorDecl*>(Dtor)); DiagnoseUseOfDecl(Dtor, Location); |