/* { dg-do compile } */
/* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
+__extension__ typedef __PTRDIFF_TYPE__ ptrdiff_t;
+
/* PR 29116. */
int n = 0, p[n * 0 + 1]; /* { dg-error "variabl|can't be evaluated" } */
/* PR 31871. */
-extern int c[1 + ((__PTRDIFF_TYPE__) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */
+extern int c[1 + ((ptrdiff_t) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */
/* Implicit conversions from floating-point constants are not OK,
although explicit ones are. */
};
enum e {
- E = (1 + ((__PTRDIFF_TYPE__) (void *) 0)), /* { dg-error "constant" } */
+ E = (1 + ((ptrdiff_t) (void *) 0)), /* { dg-error "constant" } */
E2 = 0
};
void
f (int a)
{
- int v[1 + ((__PTRDIFF_TYPE__) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */
+ int v[1 + ((ptrdiff_t) (void *) 0)]; /* { dg-error "variab|can't be evaluated" } */
switch (a)
{
case (n * 0 + 1): /* { dg-error "constant" } */