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 | 623ea82a6bc65fd28fe84a27e27afb914ad6e5f8 (patch) | |
| tree | 572a12ccfc6c7f6de8f44ecc5a8ca615d7f7d716 /clang/lib/Sema/SemaExceptionSpec.cpp | |
| parent | 9eb5a410bdb633c356acdb349299ab38e2e44b08 (diff) | |
| download | llvm-623ea82a6bc65fd28fe84a27e27afb914ad6e5f8.zip llvm-623ea82a6bc65fd28fe84a27e27afb914ad6e5f8.tar.gz llvm-623ea82a6bc65fd28fe84a27e27afb914ad6e5f8.tar.bz2 | |
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
Diffstat (limited to 'clang/lib/Sema/SemaExceptionSpec.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaExceptionSpec.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExceptionSpec.cpp b/clang/lib/Sema/SemaExceptionSpec.cpp index f1033dc..cd58f32 100644 --- a/clang/lib/Sema/SemaExceptionSpec.cpp +++ b/clang/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>(), |
