aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaType.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-08-28 20:50:45 +0000
committerDouglas Gregor <dgregor@apple.com>2009-08-28 20:50:45 +0000
commit357bbd022c1d340c8e255aea7a684ddb34bc76e5 (patch)
tree668efdbda10cd6080ad5057c6922ecb3f0278fce /lib/Sema/SemaType.cpp
parentc18faf67c366f79035e364944d7df7f281ddf5a4 (diff)
Tighten up the conversion from a single-level template argument list
to a multi-level template argument list by making it explicit. The forced auditing of callers found a bug in the instantiation of member classes inside member templates. I *love* static type systems. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80391 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaType.cpp')
-rw-r--r--lib/Sema/SemaType.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp
index 7837952353..284dea2b75 100644
--- a/lib/Sema/SemaType.cpp
+++ b/lib/Sema/SemaType.cpp
@@ -1787,14 +1787,9 @@ bool Sema::RequireCompleteType(SourceLocation Loc, QualType T,
} else if (CXXRecordDecl *Rec
= dyn_cast<CXXRecordDecl>(Record->getDecl())) {
if (CXXRecordDecl *Pattern = Rec->getInstantiatedFromMemberClass()) {
- // Find the class template specialization that surrounds this
- // member class.
- ClassTemplateSpecializationDecl *Spec = 0;
- for (DeclContext *Parent = Rec->getDeclContext();
- Parent && !Spec; Parent = Parent->getParent())
- Spec = dyn_cast<ClassTemplateSpecializationDecl>(Parent);
- assert(Spec && "Not a member of a class template specialization?");
- return InstantiateClass(Loc, Rec, Pattern, Spec->getTemplateArgs(),
+ // This record was instantiated from a class within a template.
+ return InstantiateClass(Loc, Rec, Pattern,
+ getTemplateInstantiationArgs(Rec),
/*ExplicitInstantiation=*/false,
/*Complain=*/diag != 0);
}