summaryrefslogtreecommitdiffstats
path: root/lib/Sema/SemaTemplate.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-05-23 21:00:28 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-05-23 21:00:28 +0000
commit3ccca48c69e96f10485bc7eda0a1531dee22b775 (patch)
tree8b0c99d7a58b8108ad54a2348a9b4604dccd45a1 /lib/Sema/SemaTemplate.cpp
parent63c42894e3cccbd159b94d49c823f8a4c07ca548 (diff)
[modules] If a referenced-but-not-instantiated class template specialization
gets explicitly specialized, don't reuse the previous class template specialization declaration as a new declaration. The benefit here is fairly marginal, it harms source fidelity, and this is horrible to model if the specialization was imported from another module (without this change, it asserts or worse). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209552 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplate.cpp')
-rw-r--r--lib/Sema/SemaTemplate.cpp19
1 files changed, 1 insertions, 18 deletions
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index dd2faf60d4..af80f1a5f6 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -6066,24 +6066,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
// The canonical type
QualType CanonType;
- if (PrevDecl &&
- (PrevDecl->getSpecializationKind() == TSK_Undeclared ||
- TUK == TUK_Friend)) {
- // Since the only prior class template specialization with these
- // arguments was referenced but not declared, or we're only
- // referencing this specialization as a friend, reuse that
- // declaration node as our own, updating its source location and
- // the list of outer template parameters to reflect our new declaration.
- Specialization = PrevDecl;
- Specialization->setLocation(TemplateNameLoc);
- if (TemplateParameterLists.size() > 0) {
- Specialization->setTemplateParameterListsInfo(Context,
- TemplateParameterLists.size(),
- TemplateParameterLists.data());
- }
- PrevDecl = 0;
- CanonType = Context.getTypeDeclType(Specialization);
- } else if (isPartialSpecialization) {
+ if (isPartialSpecialization) {
// Build the canonical type that describes the converted template
// arguments of the class template partial specialization.
TemplateName CanonTemplate = Context.getCanonicalTemplateName(Name);