]> granicus.if.org Git - clang/commit
[modules] Be sure to emit local specializations of imported templates, even if
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 6 Oct 2016 20:30:51 +0000 (20:30 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 6 Oct 2016 20:30:51 +0000 (20:30 +0000)
commit18a60c7f6bcb33fc30a0f223ec1369f7551040fe
tree878cd2eef8c10e15525128b3796e297fc40aacf6
parent1ffd5eaec1e27d72ac905c92a22318d01500973a
[modules] Be sure to emit local specializations of imported templates, even if
the resulting specialization is not referenced by the rest of the AST. This
both avoids performing unnecessary reinstantiations in downstream users of the
AST file and fixes a bug (breaking modules self-host right now) where we would
sometimes fail to emit a definition of a class template specialization if we
imported just a declaration of it from elsewhere (see new testcase for reduced
example).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283489 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Serialization/ASTWriter.h
lib/Serialization/ASTWriter.cpp
test/Modules/Inputs/merge-template-specializations/a.h [new file with mode: 0644]
test/Modules/Inputs/merge-template-specializations/b.h [new file with mode: 0644]
test/Modules/Inputs/merge-template-specializations/c.h [new file with mode: 0644]
test/Modules/Inputs/merge-template-specializations/module.modulemap [new file with mode: 0644]
test/Modules/cxx-templates.cpp
test/Modules/merge-template-specializations.cpp [new file with mode: 0644]