This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[C++ Patch] PR 20147


Hi,

this is, strictly speaking a 3.4/4.0/4.1 regression, but it's an
ice-on-illegal, happens only with checking enabled, and involves
only an extension ;) The fix seems rather safe, however.

Ok for mainline? Maybe 4.0 too?

Tested i686-pc-linux-gnu.

Paolo.

//////////////
cp/

	PR c++/20147
	* semantics.c (finish_stmt_expr_expr): Return immediately
	if error_operand_p (expr).

testsuite/

	PR c++/20147	
	* g++.dg/ext/stmtexpr4.C: New test.
Index: semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.464
diff -p -r1.464 semantics.c
*** semantics.c	14 Mar 2005 14:33:34 -0000	1.464
--- semantics.c	17 Mar 2005 19:47:12 -0000
*************** finish_stmt_expr_expr (tree expr, tree s
*** 1523,1528 ****
--- 1523,1531 ----
  {
    tree result = NULL_TREE;
  
+   if (error_operand_p (expr))
+     return error_mark_node;
+   
    if (expr)
      {
        if (!processing_template_decl && !VOID_TYPE_P (TREE_TYPE (expr)))
// PR c++/20147
// { dg-do compile }
// { dg-options "" }

void foo()
{
  ({x;}); // { dg-error "was not declared" }
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]