summaryrefslogtreecommitdiff
path: root/gcc/testsuite/gcc.dg/gnu99-init-2.c
blob: a4728a608843e7122d4706ee64a5f5b8873445a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
/* Test for designated initializers: array designators must be of
   integer type.  Test for index ranges (GNU extension).  */
/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
/* { dg-do compile } */
/* { dg-options "-std=gnu99" } */

int a[] = { [(void *)0 ... 0] = 1 }; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "integer type|near init" "pointer designator"  { target *-*-* } 7 } */

int b[] = { [0 ... (void *)0] = 1 }; /* { dg-bogus "warning" "warning in place of error" } */
/* { dg-error "integer type|near init" "pointer designator"  { target *-*-* } 10 } */