Reapply r121528, fixing PR9941 by delaying the exception specification check for destructors until the class is complete and destructors have been adjusted.
llvm-svn: 131632
This commit is contained in:
@@ -701,6 +701,14 @@ bool Sema::CheckExceptionSpecCompatibility(Expr *From, QualType ToType)
|
||||
|
||||
bool Sema::CheckOverridingFunctionExceptionSpec(const CXXMethodDecl *New,
|
||||
const CXXMethodDecl *Old) {
|
||||
if (getLangOptions().CPlusPlus0x && New->getParent()->isBeingDefined() &&
|
||||
isa<CXXDestructorDecl>(New)) {
|
||||
// The destructor might be updated once the definition is finished. So
|
||||
// remember it and check later.
|
||||
DelayedDestructorExceptionSpecChecks.push_back(std::make_pair(
|
||||
cast<CXXDestructorDecl>(New), cast<CXXDestructorDecl>(Old)));
|
||||
return false;
|
||||
}
|
||||
return CheckExceptionSpecSubset(PDiag(diag::err_override_exception_spec),
|
||||
PDiag(diag::note_overridden_virtual_function),
|
||||
Old->getType()->getAs<FunctionProtoType>(),
|
||||
|
||||
Reference in New Issue
Block a user