Initial stab at implement dependent member references to member
templates, e.g.,
x.template get<T>
We can now parse these, represent them within an UnresolvedMemberExpr
expression, then instantiate that expression node in simple cases.
This allows us to stumble through parsing LLVM's Casting.h.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@81300 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index bc2c304..dc45518 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -1229,7 +1229,7 @@
else if (OverloadedFunctionDecl *Ovl = Template.getAsOverloadedFunctionDecl())
Name = Ovl->getDeclName();
else
- assert(false && "Cannot support dependent template names yet");
+ Name = Template.getAsDependentTemplateName()->getName();
// Translate the parser's template argument list in our AST format.
llvm::SmallVector<TemplateArgument, 16> TemplateArgs;
@@ -1287,11 +1287,6 @@
return Template;
}
- // FIXME: We need to be able to create a dependent template name with just
- // an identifier, to handle the x->template f<T> case.
- assert(!ObjectType &&
- "Cannot handle dependent template names without a nested-name-specifier");
-
NestedNameSpecifier *Qualifier
= static_cast<NestedNameSpecifier *>(SS.getScopeRep());
return TemplateTy::make(Context.getDependentTemplateName(Qualifier, &Name));