diff options
author | Alp Toker <alp@nuanti.com> | 2013-10-17 19:12:03 +0000 |
---|---|---|
committer | Alp Toker <alp@nuanti.com> | 2013-10-17 19:12:03 +0000 |
commit | de0be6232bff7fcec6df6e1a1ae4560c5b9148c1 (patch) | |
tree | d07dbaa520bbbf7d89b4cf0142c394330ba2237a /clang/lib/Sema/Sema.cpp | |
parent | 959f04077cda4e2b4a4ffdf01351effe983d5e6e (diff) | |
download | bcm5719-llvm-de0be6232bff7fcec6df6e1a1ae4560c5b9148c1.tar.gz bcm5719-llvm-de0be6232bff7fcec6df6e1a1ae4560c5b9148c1.zip |
Fix missed exception spec checks and crashes
Delayed exception specification checking for defaulted members and virtual
destructors are both susceptible to mutation during iteration so we need to
process the worklists fully.
This resolves both accepts-invalid and rejects-valid issues and moreover fixes
potential invalid memory access as the contents of the vectors change during
iteration and recursive template instantiation.
This patch also adds two assertions at end of TU to ensure no specs are left
unchecked as was happenning before the fix, plus a test case from Marshall Clow
for the defaulted member crash extracted from the libcxx headers.
Reviewed by Richard Smith.
llvm-svn: 192914
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r-- | clang/lib/Sema/Sema.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp index 59648441a6d..31de6524a44 100644 --- a/clang/lib/Sema/Sema.cpp +++ b/clang/lib/Sema/Sema.cpp @@ -792,6 +792,11 @@ void Sema::ActOnEndOfTranslationUnit() { } } + // All delayed member exception specs should be checked or we end up accepting + // incompatible declarations. + assert(DelayedDefaultedMemberExceptionSpecs.empty()); + assert(DelayedDestructorExceptionSpecChecks.empty()); + // Check we've noticed that we're no longer parsing the initializer for every // variable. If we miss cases, then at best we have a performance issue and // at worst a rejects-valid bug. |