re PR c/45079 (function names in error message (�c_maybe_const_expr� not supported by 'pp_c_expression'))

PR c/45079
	* c-pretty-print.c (pp_c_expression): Handle C_MAYBE_CONST_EXPR.

	* gcc.dg/pr45079.c: New test.

From-SVN: r162575
This commit is contained in:
Jakub Jelinek 2010-07-27 17:46:25 +02:00 committed by Jakub Jelinek
parent a78e242c07
commit f551f80cd1
4 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2010-07-27 Jakub Jelinek <jakub@redhat.com>
PR c/45079
* c-pretty-print.c (pp_c_expression): Handle C_MAYBE_CONST_EXPR.
2010-07-27 Joseph Myers <joseph@codesourcery.com>
* c-common.h (c_common_missing_argument): Remove.

View File

@ -2167,6 +2167,10 @@ pp_c_expression (c_pretty_printer *pp, tree e)
pp_string (pp, "({...})");
break;
case C_MAYBE_CONST_EXPR:
pp_c_expression (pp, C_MAYBE_CONST_EXPR_EXPR (e));
break;
default:
pp_unsupported_tree (pp, e);
break;

View File

@ -1,3 +1,8 @@
2010-07-27 Jakub Jelinek <jakub@redhat.com>
PR c/45079
* gcc.dg/pr45079.c: New test.
2010-07-27 Ira Rosen <irar@il.ibm.com>
PR tree-optimization/44152

View File

@ -0,0 +1,10 @@
/* PR c/45079 */
/* { dg-do compile } */
void
foo (const char *p, int cond, int a, int b)
{
p[cond ? a : b] = '\0'; /* { dg-error "assignment of read-only location" } */
}
/* { dg-bogus "not supported by" "" { target *-*-* } 0 } */