diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-13 11:45:48 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2010-09-13 11:45:48 +0000 |
commit | 99a8ca0bdbf97f7b05f3f8aed05ff495caea5b84 (patch) | |
tree | eba11825ca533ad7388c591eaf038dd849dc1567 /lib/Serialization/ASTWriterDecl.cpp | |
parent | 8fed4b4bc93cce4d15bdb79f9e30cc25a93c8143 (diff) |
Fix C++ PCH issue.
The canonical FunctionTemplateDecl contains the specializations but we cannot use getCanonicalDecl on Template because it may still be initializing.
Write and read it from PCH.
Fixes http://llvm.org/PR8134
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@113744 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ASTWriterDecl.cpp')
-rw-r--r-- | lib/Serialization/ASTWriterDecl.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/Serialization/ASTWriterDecl.cpp b/lib/Serialization/ASTWriterDecl.cpp index 3f990e7a56..76974667a8 100644 --- a/lib/Serialization/ASTWriterDecl.cpp +++ b/lib/Serialization/ASTWriterDecl.cpp @@ -257,6 +257,12 @@ void ASTDeclWriter::VisitFunctionDecl(FunctionDecl *D) { } Writer.AddSourceLocation(FTSInfo->getPointOfInstantiation(), Record); + + if (D->isCanonicalDecl()) { + // Write the template that contains the specializations set. We will + // add a FunctionTemplateSpecializationInfo to it when reading. + Writer.AddDeclRef(FTSInfo->getTemplate()->getCanonicalDecl(), Record); + } break; } case FunctionDecl::TK_DependentFunctionTemplateSpecialization: { |