diff options
author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-05-19 05:13:44 +0000 |
---|---|---|
committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2011-05-19 05:13:44 +0000 |
commit | 0ee33912f8ec3453856c8a32ed2c2e8007bed614 (patch) | |
tree | 887686892830c03a091a7f86f4ac67a78fc00619 /lib/Sema/SemaExceptionSpec.cpp | |
parent | 6e744db7c294f357e7e0af628275331f3a6c1b6b (diff) |
Reapply r121528, fixing PR9941 by delaying the exception specification check for destructors until the class is complete and destructors have been adjusted.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@131632 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r-- | lib/Sema/SemaExceptionSpec.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Sema/SemaExceptionSpec.cpp b/lib/Sema/SemaExceptionSpec.cpp index f1033dc8c2..cd58f32fd4 100644 --- a/lib/Sema/SemaExceptionSpec.cpp +++ b/lib/Sema/SemaExceptionSpec.cpp @@ -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>(), |