]> granicus.if.org Git - clang/commit
PR31469: Don't add friend template class decls to redecl chain in dependent contexts.
authorVassil Vassilev <v.g.vassilev@gmail.com>
Thu, 12 Jan 2017 09:16:26 +0000 (09:16 +0000)
committerVassil Vassilev <v.g.vassilev@gmail.com>
Thu, 12 Jan 2017 09:16:26 +0000 (09:16 +0000)
commitde0c61bab9ebf86a08a18b281fe018f3a5eed358
treede8c2c169d326c4dc2869794d3f250e7db944db6
parent5ceef6b013ae141fdda2dcda40d5f65e44693075
PR31469: Don't add friend template class decls to redecl chain in dependent contexts.

Fixes a crash in modules where the template class decl becomes the most recent
decl in the redeclaration chain and forcing the template instantiator try to
instantiate the friend declaration, rather than the template definition.

In practice, A::list<int> produces a TemplateSpecializationType
A::__1::list<int, allocator<type-parameter-0-0> >' failing to replace to
subsitute the default argument to allocator<int>.

Kudos Richard Smith (D28399).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@291753 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/DeclTemplate.h
lib/AST/ASTImporter.cpp
lib/AST/DeclTemplate.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
test/Misc/ast-dump-decl.cpp
test/Modules/Inputs/PR31469/empty.h [new file with mode: 0644]
test/Modules/Inputs/PR31469/module.modulemap [new file with mode: 0644]
test/Modules/Inputs/PR31469/textual.h [new file with mode: 0644]
test/Modules/Inputs/PR31469/textual_file_shadow.h [new file with mode: 0644]
test/Modules/pr31469.cpp [new file with mode: 0644]