static-init.c revision 839508150a7a595b6172217eeddc4d024fc201c5
1// RUN: clang -fsyntax-only -verify %s 2static int f = 10; 3static int b = f; // expected-error {{initializer element is not a compile-time constant}} 4 5float r = (float) &r; // FIXME: should give an error: ptr value used where a float was expected 6long long s = (long long) &s; 7_Bool t = &t; 8 9 10union bar { 11 int i; 12}; 13 14struct foo { 15 unsigned ptr; 16}; 17 18union bar u[1]; 19struct foo x = {(int) u}; // no-error 20