Assert when we try to mangle a dependent template name, rather than

crashing unceremoniously.

llvm-svn: 95464
This commit is contained in:
Douglas Gregor 2010-02-06 01:09:36 +00:00
parent 52cc0897f3
commit cae03b1e6d
1 changed files with 3 additions and 1 deletions

View File

@ -1104,7 +1104,7 @@ void CXXNameMangler::mangleType(const TypenameType *T) {
dyn_cast<TemplateSpecializationType>(QTy)) {
if (!mangleSubstitution(QualType(TST, 0))) {
TemplateDecl *TD = TST->getTemplateName().getAsTemplateDecl();
assert(TD && "FIXME: Support dependent template names");
mangleTemplatePrefix(TD);
mangleTemplateArgs(TST->getArgs(), TST->getNumArgs());
addSubstitution(QualType(TST, 0));
@ -1467,6 +1467,8 @@ void CXXNameMangler::mangleTemplateArg(const TemplateArgument &A) {
mangleType(A.getAsType());
break;
case TemplateArgument::Template:
assert(A.getAsTemplate().getAsTemplateDecl() &&
"FIXME: Support dependent template names");
mangleName(A.getAsTemplate().getAsTemplateDecl());
break;
case TemplateArgument::Expression: