summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/c90-array-lval-6.c
blob: f42ef52bd190167a8be3f16d6122e7e2fcb59308 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/* PR c/12446 */
/* Origin: Keith Thompson <kst@cts.com> */

/* { dg-do compile } */
/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */


struct s { char c[1]; };

extern struct s foo(void);

void bar(void)
{
  char *ptr = foo().c; /* { dg-bogus "warning" "warning in place of error" } */
}
/* { dg-error "non-lvalue" "array not decaying to lvalue" { target *-*-* } 14 } */