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:
parent
7d793e9b25
commit
ae5d234e11
|
@ -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
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
/* PR c/5225 */
|
||||
/* { dg-do compile } */
|
||||
|
||||
int main()
|
||||
{
|
||||
int i;
|
||||
+i = 1; /* { dg-error "invalid lvalue in assignment" } */
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue