]> granicus.if.org Git - clang/commit
When two templates get merged together, also merge their pattern declarations
authorRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 24 Apr 2014 02:25:27 +0000 (02:25 +0000)
committerRichard Smith <richard-llvm@metafoo.co.uk>
Thu, 24 Apr 2014 02:25:27 +0000 (02:25 +0000)
commitedc6f0f85a7e47a6556dcb333015e8d7a96dfa5b
tree2c3f64bf47d66a8025c88bf75a1e6e206fc8fbfc
parentcc423c3c6929b144f391c998ab6c550d7735e31b
When two templates get merged together, also merge their pattern declarations
together. This is extremely hairy, because in general we need to have loaded
both the template and the pattern before we can determine whether either should
be merged, so we temporarily violate the rule that all merging happens before
reading a decl ends, but *only* in the case where a template's pattern is being
loaded while loading the template itself.

In order to accomodate this for class templates, delay loading the injected
class name type for the pattern of the template until after we've loaded the
template itself, if we happen to load the template first.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207063 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTReaderDecl.cpp
test/Modules/Inputs/templates-left.h
test/Modules/Inputs/templates-right.h
test/Modules/cxx-templates.cpp
test/Modules/templates.mm