... and this is a more straightforward approach. Also tested x86_64-linux.

Thanks!
Paolo.

/////////////////////
/cp
2013-10-04  Paolo Carlini  <paolo.carl...@oracle.com>

        PR c++/58448
        * pt.c (tsubst): Use error_operand_p on parameter t.

/testsuite
2013-10-04  Paolo Carlini  <paolo.carl...@oracle.com>

        PR c++/58448
        * g++.dg/template/crash117.C: New.
Index: cp/pt.c
===================================================================
--- cp/pt.c     (revision 203200)
+++ cp/pt.c     (working copy)
@@ -11272,7 +11272,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain
   enum tree_code code;
   tree type, r = NULL_TREE;
 
-  if (t == NULL_TREE || t == error_mark_node
+  if (t == NULL_TREE
       || t == integer_type_node
       || t == void_type_node
       || t == char_type_node
@@ -11281,6 +11281,9 @@ tsubst (tree t, tree args, tsubst_flags_t complain
       || TREE_CODE (t) == TRANSLATION_UNIT_DECL)
     return t;
 
+  if (error_operand_p (t))
+    return error_mark_node;
+
   if (DECL_P (t))
     return tsubst_decl (t, args, complain);
 
Index: testsuite/g++.dg/template/crash117.C
===================================================================
--- testsuite/g++.dg/template/crash117.C        (revision 0)
+++ testsuite/g++.dg/template/crash117.C        (working copy)
@@ -0,0 +1,6 @@
+// PR c++/58448
+
+class SmallVector; struct Types4;
+template <typename, typename, typename, typename> struct Types {
+  typedef Types4<>::Constructable // { dg-error "template|typedef|expected" }
+} Types<SmallVector, SmallVector, SmallVector, SmallVector>:: > // { dg-error 
"expected" }

Reply via email to