Commit ae5d234e by Richard Henderson Committed by Richard Henderson

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
parent 7d793e9b
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> 2002-04-26 Mark Mitchell <mark@codesourcery.com>
PR bootstrap/6445 PR bootstrap/6445
......
...@@ -2759,6 +2759,7 @@ build_unary_op (code, xarg, flag) ...@@ -2759,6 +2759,7 @@ build_unary_op (code, xarg, flag)
} }
else if (!noconvert) else if (!noconvert)
arg = default_conversion (arg); arg = default_conversion (arg);
arg = non_lvalue (arg);
break; break;
case NEGATE_EXPR: case NEGATE_EXPR:
......
/* PR c/5225 */
/* { dg-do compile } */
int main()
{
int i;
+i = 1; /* { dg-error "invalid lvalue in assignment" } */
return 0;
}
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