view gcc/testsuite/gcc.dg/pr60139.c @ 158:494b0b89df80 default tip

...
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 25 May 2020 18:13:55 +0900
parents 04ced10e8804
children
line wrap: on
line source

/* PR c/60139 */
/* { dg-do compile } */
/* { dg-options "-Wpedantic -std=gnu89" } */
/* { dg-prune-output ".*near initialization for.*" } */

double sin (double);
void
fn (int *p)
{
  int **a[] = { &p, /* { dg-warning "17:initializer element is not computable at load time" } */
               (void *) 0, &p }; /* { dg-warning "28:initializer element is not computable at load time" } */
  double d[] = { sin (1.0), /* { dg-warning "18:initializer element is not a constant expression" } */
                 8.8, sin (1.0), 2.6 }; /* { dg-warning "23:initializer element is not a constant expression" } */
}