]> granicus.if.org Git - clang/commit
Fix missed exception spec checks and crashes
authorAlp Toker <alp@nuanti.com>
Thu, 17 Oct 2013 19:12:03 +0000 (19:12 +0000)
committerAlp Toker <alp@nuanti.com>
Thu, 17 Oct 2013 19:12:03 +0000 (19:12 +0000)
commitbb81f880aa77cfd09dedfc72a9b87262889ae75c
treeca622d101ca9d604c169872973967e5d9022442f
parent52f717eba7eff69c97d64de5e3669f4a5ee57d5c
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192914 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/Sema.h
lib/Sema/Sema.cpp
lib/Sema/SemaDeclCXX.cpp
test/SemaTemplate/exception-spec-crash.cpp [new file with mode: 0644]