[cfe-commits] r95464 - /cfe/trunk/lib/CodeGen/Mangle.cpp

Douglas Gregor dgregor at apple.com
Fri Feb 5 17:09:37 PST 2010


Author: dgregor
Date: Fri Feb  5 19:09:36 2010
New Revision: 95464

URL: http://llvm.org/viewvc/llvm-project?rev=95464&view=rev
Log:
Assert when we try to mangle a dependent template name, rather than
crashing unceremoniously.

Modified:
    cfe/trunk/lib/CodeGen/Mangle.cpp

Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=95464&r1=95463&r2=95464&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Fri Feb  5 19:09:36 2010
@@ -1104,7 +1104,7 @@
         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 @@
     mangleType(A.getAsType());
     break;
   case TemplateArgument::Template:
+    assert(A.getAsTemplate().getAsTemplateDecl() &&
+           "FIXME: Support dependent template names");
     mangleName(A.getAsTemplate().getAsTemplateDecl());
     break;      
   case TemplateArgument::Expression:





More information about the cfe-commits mailing list