re PR c/17730 (Regression in diagnost message "invalid lvalue in unary %<&%>")

PR c/17730
	* c-typeck.c (lvalue_or_else): Pass msgid directly to error.

testsuite:
	* gcc.dg/pr17730-1.c: New test

From-SVN: r88343
This commit is contained in:
Joseph Myers 2004-09-30 19:17:54 +01:00 committed by Joseph Myers
parent 9c9e97bdb4
commit 254ac10c31
4 changed files with 19 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2004-09-30 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/17730
* c-typeck.c (lvalue_or_else): Pass msgid directly to error.
2004-09-30 Diego Novillo <dnovillo@redhat.com>
* tree-ssa-alias.c (collect_points_to_info_r): Move analysis of

View File

@ -2682,7 +2682,9 @@ lvalue_p (tree ref)
}
/* Return nonzero if REF is an lvalue valid for this language;
otherwise, print an error message and return zero. */
otherwise, print an error message and return zero. MSGID
is a format string which receives no arguments, but in which
formats such as %< and %> may occur. */
static int
lvalue_or_else (tree ref, const char *msgid)
@ -2690,7 +2692,7 @@ lvalue_or_else (tree ref, const char *msgid)
int win = lvalue_p (ref);
if (! win)
error ("%s", msgid);
error (msgid);
return win;
}

View File

@ -1,3 +1,8 @@
2004-09-30 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/17730
* gcc.dg/pr17730-1.c: New test
2004-09-29 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/7425

View File

@ -0,0 +1,5 @@
/* Test formatting of message for invalid lvalue. Bug 17730. */
/* { dg-do compile } */
/* { dg-options "" } */
char *p = &'C'; /* { dg-error "error: invalid lvalue in unary '&'" } */