diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-10-12 20:18:28 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-10-12 20:18:28 +0000 |
commit | b3ae4fcd4314a9c1c46d41b200883599c32025b4 (patch) | |
tree | a25ed84a04f126c2beae7a3b09dc855d7c37d196 /lib/Sema/SemaType.cpp | |
parent | 2ebe7ebb1d6149a1845dd3169009f99b78e91bc9 (diff) |
Diagnose the declaration of explicit specializations after an implicit
instantiation has already been required. To do so, keep track of the
point of instantiation for anything that can be instantiated.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@83890 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r-- | lib/Sema/SemaType.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index b82e5ec9b1..3cdf615423 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -1677,12 +1677,17 @@ bool Sema::RequireCompleteType(SourceLocation Loc, QualType T, } else if (CXXRecordDecl *Rec = dyn_cast<CXXRecordDecl>(Record->getDecl())) { if (CXXRecordDecl *Pattern = Rec->getInstantiatedFromMemberClass()) { + MemberSpecializationInfo *MSInfo = Rec->getMemberSpecializationInfo(); + assert(MSInfo && "Missing member specialization information?"); // This record was instantiated from a class within a template. - if (Rec->getTemplateSpecializationKind() != TSK_ExplicitSpecialization) + if (MSInfo->getTemplateSpecializationKind() + != TSK_ExplicitSpecialization) { + MSInfo->setPointOfInstantiation(Loc); return InstantiateClass(Loc, Rec, Pattern, getTemplateInstantiationArgs(Rec), TSK_ImplicitInstantiation, /*Complain=*/diag != 0); + } } } } |