Commit 254ac10c by Joseph Myers Committed by Joseph Myers

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
parent 9c9e97bd
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> 2004-09-30 Diego Novillo <dnovillo@redhat.com>
* tree-ssa-alias.c (collect_points_to_info_r): Move analysis of * tree-ssa-alias.c (collect_points_to_info_r): Move analysis of
......
...@@ -2682,7 +2682,9 @@ lvalue_p (tree ref) ...@@ -2682,7 +2682,9 @@ lvalue_p (tree ref)
} }
/* Return nonzero if REF is an lvalue valid for this language; /* 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 static int
lvalue_or_else (tree ref, const char *msgid) lvalue_or_else (tree ref, const char *msgid)
...@@ -2690,7 +2692,7 @@ 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); int win = lvalue_p (ref);
if (! win) if (! win)
error ("%s", msgid); error (msgid);
return win; return win;
} }
......
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> 2004-09-29 Joseph S. Myers <jsm@polyomino.org.uk>
PR c/7425 PR c/7425
......
/* Test formatting of message for invalid lvalue. Bug 17730. */
/* { dg-do compile } */
/* { dg-options "" } */
char *p = &'C'; /* { dg-error "error: invalid lvalue in unary '&'" } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment