annotate gcc/testsuite/gcc.dg/lvalue-8.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* PR c/66341 */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3
kono
parents:
diff changeset
4 void
kono
parents:
diff changeset
5 foo (int *p)
kono
parents:
diff changeset
6 {
kono
parents:
diff changeset
7 p = 0;
kono
parents:
diff changeset
8 /* A cast does not yield an lvalue. */
kono
parents:
diff changeset
9 (int *) p = 0; /* { dg-error "lvalue required as left operand of assignment" } */
kono
parents:
diff changeset
10 /* A cast to a qualified type has the same effect as a cast
kono
parents:
diff changeset
11 to the unqualified version of the type. */
kono
parents:
diff changeset
12 (int *const) p = 0; /* { dg-error "lvalue required as left operand of assignment" } */
kono
parents:
diff changeset
13 (int *) (char *) p = 0; /* { dg-error "lvalue required as left operand of assignment" } */
kono
parents:
diff changeset
14 (int *) (char *) (int *) p = 0; /* { dg-error "lvalue required as left operand of assignment" } */
kono
parents:
diff changeset
15 (int *) (char *) (int *) (char *) p = 0; /* { dg-error "lvalue required as left operand of assignment" } */
kono
parents:
diff changeset
16 (int *) (double *) p = 0; /* { dg-error "lvalue required as left operand of assignment" } */
kono
parents:
diff changeset
17 (int *) (int *) p = 0; /* { dg-error "lvalue required as left operand of assignment" } */
kono
parents:
diff changeset
18 (int *) (int *const) p = 0; /* { dg-error "lvalue required as left operand of assignment" } */
kono
parents:
diff changeset
19 }