summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization/ASTReaderDecl.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-07-11 00:20:06 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-07-11 00:20:06 +0000
commitdc5523d38fc12d167d83b8d4732a78fbf9be70b4 (patch)
treee45ad19f76dc62e7ea3db850a6d8e01c10d0d6d0 /clang/lib/Serialization/ASTReaderDecl.cpp
parent7660d653c8173f9586a2e8a5a4f9e2516de7ca7c (diff)
downloadbcm5719-llvm-dc5523d38fc12d167d83b8d4732a78fbf9be70b4.tar.gz
bcm5719-llvm-dc5523d38fc12d167d83b8d4732a78fbf9be70b4.zip
[modules] Don't try to merge template specializations by performing name lookup
into their container; we won't find them there. These things are already being merged when they're added to their primary template's folding set, so this merging is redundant (and causes us to reject-valid because we think we've found an odr violation). llvm-svn: 212788
Diffstat (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp')
-rw-r--r--clang/lib/Serialization/ASTReaderDecl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp
index d8495da1bac..f9fed46ad9c 100644
--- a/clang/lib/Serialization/ASTReaderDecl.cpp
+++ b/clang/lib/Serialization/ASTReaderDecl.cpp
@@ -1017,7 +1017,8 @@ ASTDeclReader::RedeclarableResult ASTDeclReader::VisitVarDeclImpl(VarDecl *VD) {
switch ((VarKind)Record[Idx++]) {
case VarNotTemplate:
// Only true variables (not parameters or implicit parameters) can be merged
- if (VD->getKind() != Decl::ParmVar && VD->getKind() != Decl::ImplicitParam)
+ if (VD->getKind() != Decl::ParmVar && VD->getKind() != Decl::ImplicitParam &&
+ !isa<VarTemplateSpecializationDecl>(VD))
mergeRedeclarable(VD, Redecl);
break;
case VarTemplate:
@@ -1438,7 +1439,9 @@ ASTDeclReader::VisitCXXRecordDeclImpl(CXXRecordDecl *D) {
};
switch ((CXXRecKind)Record[Idx++]) {
case CXXRecNotTemplate:
- mergeRedeclarable(D, Redecl);
+ // Merged when we merge the folding set entry in the primary template.
+ if (!isa<ClassTemplateSpecializationDecl>(D))
+ mergeRedeclarable(D, Redecl);
break;
case CXXRecTemplate: {
// Merged when we merge the template.
OpenPOWER on IntegriCloud