]> granicus.if.org Git - clang/commit
Make sure that vtables referenced from delay-parsed templates get referenced.
authorNico Weber <nicolasweber@gmx.de>
Fri, 15 Aug 2014 23:21:41 +0000 (23:21 +0000)
committerNico Weber <nicolasweber@gmx.de>
Fri, 15 Aug 2014 23:21:41 +0000 (23:21 +0000)
commit4a38c1f9dd8045503a8c6bb7855232a5eba4566b
tree24491e378995d56b8428b072a267836ddd9a3c20
parent170ebf4f19459ae51a9561d0e65c87ee4c9b2c97
Make sure that vtables referenced from delay-parsed templates get referenced.

This fixes PR20671, see the bug for details. In short, ActOnTranslationUnit()
calls DefineUsedVTables() and only then PerformPendingInstantiations(). But
PerformPendingInstantiations() is what does delayed template parsing, so
vtables only references from late-parsed templates weren't marked used.

As a fix, move the SavePendingInstantiationsAndVTableUsesRAII in
PerformPendingInstantiations() up above the delayed template parsing code.
That way, vtables referenced from templates end up in the RAII object, and the
call to DefineUsedVTables() in PerformPendingInstantiations() marks them used.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@215786 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaTemplateInstantiateDecl.cpp
test/CodeGenCXX/microsoft-abi-structors-delayed-template.cpp [new file with mode: 0644]