diff mbox

[C++] PR 58448

Message ID 524EAED3.80102@oracle.com
State New
Headers show

Commit Message

Paolo Carlini Oct. 4, 2013, 12:04 p.m. UTC
... and this is a more straightforward approach. Also tested x86_64-linux.

Thanks!
Paolo.

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

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

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

	PR c++/58448
	* g++.dg/template/crash117.C: New.

Comments

Jason Merrill Oct. 4, 2013, 9:07 p.m. UTC | #1
OK.

Jason
Paolo Carlini Oct. 8, 2013, 9:56 p.m. UTC | #2
On 10/04/2013 02:04 PM, Paolo Carlini wrote:
> ... and this is a more straightforward approach. Also tested x86_64-linux.
I reverted this for now. Was causing problems (c++/58665).

Thanks,
Paolo.
diff mbox

Patch

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" }