diff options
author | Alp Toker <alp@nuanti.com> | 2013-10-17 21:00:19 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2013-10-17 21:00:19 +0000 |
commit | be2a55f5ac9c02ac4b55112f27c3fb6bad6523cb (patch) | |
tree | a0b7cc120f66c27f2eb3a05c559f28b0836c969f /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | a0191d11014c8da974e8d94fc95bffe78abb24fb (diff) | |
download | bcm5719-llvm-be2a55f5ac9c02ac4b55112f27c3fb6bad6523cb.tar.gz bcm5719-llvm-be2a55f5ac9c02ac4b55112f27c3fb6bad6523cb.zip |
Revert "Fix missed exception spec checks and crashes"
The changes caused the sanitizer bot to hang:
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/builds/2311
Needs investigation.
This reverts commit r192914.
llvm-svn: 192921
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 0355a981b2b..bd864b3adbc 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -4864,27 +4864,14 @@ void Sema::CheckExplicitlyDefaultedMemberExceptionSpec( SpecifiedType, MD->getLocation()); } -void Sema::CheckDelayedMemberExceptionSpecs() { - // Perform any deferred checking of exception specifications for virtual - // destructors. - while (!DelayedDestructorExceptionSpecChecks.empty()) { - std::pair<const CXXDestructorDecl *, const CXXDestructorDecl *> Check = - DelayedDestructorExceptionSpecChecks.pop_back_val(); - const CXXDestructorDecl *Dtor = Check.first; - assert(!Dtor->getParent()->isDependentType() && - "Should not ever add destructors of templates into the list."); - CheckOverridingFunctionExceptionSpec(Dtor, Check.second); - } - - // Check that any explicitly-defaulted methods have exception specifications - // compatible with their implicit exception specifications. - while (!DelayedDefaultedMemberExceptionSpecs.empty()) { - std::pair<CXXMethodDecl *, const FunctionProtoType *> Spec = - DelayedDefaultedMemberExceptionSpecs.pop_back_val(); - CheckExplicitlyDefaultedMemberExceptionSpec(Spec.first, Spec.second); - } +void Sema::CheckDelayedExplicitlyDefaultedMemberExceptionSpecs() { + for (unsigned I = 0, N = DelayedDefaultedMemberExceptionSpecs.size(); + I != N; ++I) + CheckExplicitlyDefaultedMemberExceptionSpec( + DelayedDefaultedMemberExceptionSpecs[I].first, + DelayedDefaultedMemberExceptionSpecs[I].second); - assert(DelayedDestructorExceptionSpecChecks.empty()); + DelayedDefaultedMemberExceptionSpecs.clear(); } namespace { @@ -8195,8 +8182,9 @@ void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation, } void Sema::ActOnFinishDelayedMemberInitializers(Decl *D) { - // Perform any delayed checks on exception specifications. - CheckDelayedMemberExceptionSpecs(); + // Check that any explicitly-defaulted methods have exception specifications + // compatible with their implicit exception specifications. + CheckDelayedExplicitlyDefaultedMemberExceptionSpecs(); // Once all the member initializers are processed, perform checks to see if // any unintialized use is happeneing. @@ -8719,11 +8707,23 @@ void Sema::ActOnFinishCXXMemberDecls() { // If the context is an invalid C++ class, just suppress these checks. if (CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(CurContext)) { if (Record->isInvalidDecl()) { - DelayedDefaultedMemberExceptionSpecs.clear(); DelayedDestructorExceptionSpecChecks.clear(); return; } } + + // Perform any deferred checking of exception specifications for virtual + // destructors. + for (unsigned i = 0, e = DelayedDestructorExceptionSpecChecks.size(); + i != e; ++i) { + const CXXDestructorDecl *Dtor = + DelayedDestructorExceptionSpecChecks[i].first; + assert(!Dtor->getParent()->isDependentType() && + "Should not ever add destructors of templates into the list."); + CheckOverridingFunctionExceptionSpec(Dtor, + DelayedDestructorExceptionSpecChecks[i].second); + } + DelayedDestructorExceptionSpecChecks.clear(); } void Sema::AdjustDestructorExceptionSpec(CXXRecordDecl *ClassDecl, |