public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [C++ PATCH] Fix ice-on-invalid calling get_unwidened (error_mark_node, ) (PR c++/32567)
@ 2007-08-21 18:53 Jakub Jelinek
  2007-08-24  1:14 ` Mark Mitchell
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2007-08-21 18:53 UTC (permalink / raw)
  To: gcc-patches

Hi!

On the following testcase the FE is calling get_unwidened on
error_mark_node.  As that is not a FE routine, but used by the tree
optimizers as well, I think it is better to avoid calling it with
error_mark_node instead of changing get_unwidened to pass through
error_mark_node.

Ok for trunk?

2007-08-21  Jakub Jelinek  <jakub@redhat.com>

	PR c++/32567
	* typeck.c (build_unary_op) <case PREINCREMENT_EXPR>: Return
	error_mark_node right away if build_expr_type_conversion
	returned it.

--- gcc/cp/typeck.c.jj	2007-08-21 08:13:43.000000000 +0200
+++ gcc/cp/typeck.c	2007-08-21 19:31:44.000000000 +0200
@@ -4259,6 +4259,8 @@ build_unary_op (enum tree_code code, tre
 	    errstring ="no post-decrement operator for type";
 	  break;
 	}
+      else if (arg == error_mark_node)
+	return error_mark_node;
 
       /* Report something read-only.  */
 
--- gcc/testsuite/g++.dg/parse/crash36.C.jj	2007-08-21 19:33:27.000000000 +0200
+++ gcc/testsuite/g++.dg/parse/crash36.C	2007-08-21 19:38:31.000000000 +0200
@@ -0,0 +1,11 @@
+// PR c++/32567
+// { dg-do compile }
+// { dg-options "-std=c++98" }
+
+template <typename... T> struct A	// { dg-error "does not include variadic templates" }
+{
+  static T &t;				// { dg-error "not expanded with|T" }
+  static const int i = sizeof (++t);	// { dg-error "invalid use of template type parameter" }
+};
+
+int x[A <int>::i];	// { dg-error "is not an integral constant-expression" }

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-08-24  1:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-21 18:53 [C++ PATCH] Fix ice-on-invalid calling get_unwidened (error_mark_node, ) (PR c++/32567) Jakub Jelinek
2007-08-24  1:14 ` Mark Mitchell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).