c-typeck.c (build_unary_op): Invoke non_lvalue.

* c-typeck.c (build_unary_op) [CONVERT_EXPR]: Invoke non_lvalue.
	* gcc.dg/lvalue1.c: New.

From-SVN: r52812
This commit is contained in:
Richard Henderson 2002-04-26 14:56:55 -07:00 committed by Richard Henderson
parent 7d793e9b25
commit ae5d234e11
3 changed files with 15 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2002-04-26 Richard Henderson <rth@redhat.com>
PR c/5225
* c-typeck.c (build_unary_op) [CONVERT_EXPR]: Invoke non_lvalue.
2002-04-26 Mark Mitchell <mark@codesourcery.com>
PR bootstrap/6445

View File

@ -2759,6 +2759,7 @@ build_unary_op (code, xarg, flag)
}
else if (!noconvert)
arg = default_conversion (arg);
arg = non_lvalue (arg);
break;
case NEGATE_EXPR:

View File

@ -0,0 +1,9 @@
/* PR c/5225 */
/* { dg-do compile } */
int main()
{
int i;
+i = 1; /* { dg-error "invalid lvalue in assignment" } */
return 0;
}