summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTWriterDecl.cpp
diff options
context:
space:
mode:
authorAxel Naumann <Axel.Naumann@cern.ch>2012-10-01 07:34:47 +0000
committerAxel Naumann <Axel.Naumann@cern.ch>2012-10-01 07:34:47 +0000
commita31dee2e04da90852e03628ca80949b992d4eabd (patch)
treedc205f185026c7adf96a3247b1edac1223ffd242 /clang/lib/Serialization/ASTWriterDecl.cpp
parent4ca8ca916ea5bb3335081ffa099bcdf2db13f080 (diff)
downloadbcm5719-llvm-a31dee2e04da90852e03628ca80949b992d4eabd.tar.gz
bcm5719-llvm-a31dee2e04da90852e03628ca80949b992d4eabd.zip
Bring ASTReader and Writer into sync for the case where a canonical template specialization was written, which is non-canonical at the time of reading: force the reading of the ClassTemplateDecl if it was written.
The easiest way out is to store whether the decl was canonical at the time of writing. Add test. llvm-svn: 164927
Diffstat (limited to 'clang/lib/Serialization/ASTWriterDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTWriterDecl.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Serialization/ASTWriterDecl.cpp b/clang/lib/Serialization/ASTWriterDecl.cpp
index 7122bca9699..0f9bb3824b8 100644
--- a/clang/lib/Serialization/ASTWriterDecl.cpp
+++ b/clang/lib/Serialization/ASTWriterDecl.cpp
@@ -1106,6 +1106,7 @@ void ASTDeclWriter::VisitClassTemplateSpecializationDecl(
Writer.AddTemplateArgumentList(&D->getTemplateArgs(), Record);
Writer.AddSourceLocation(D->getPointOfInstantiation(), Record);
Record.push_back(D->getSpecializationKind());
+ Record.push_back(D->isCanonicalDecl());
if (D->isCanonicalDecl()) {
// When reading, we'll add it to the folding set of the following template.
OpenPOWER on IntegriCloud