blob: a4035e69df466f14dbc343169aede19ae68bf93e [file] [log] [blame]
Anders Carlsson1a86b332007-10-17 00:52:43 +00001// RUN: clang -fsyntax-only -verify %s
2static int f = 10;
Chris Lattnerd8803632008-08-10 01:58:45 +00003static int b = f; // expected-error {{initializer element is not a compile-time constant}}
Eli Friedmanc1cc6dc2008-05-30 18:14:48 +00004
Nuno Lopes83950812009-02-02 16:07:41 +00005float r = (float) &r; // FIXME: should give an error: ptr value used where a float was expected
Eli Friedmanc1cc6dc2008-05-30 18:14:48 +00006long long s = (long long) &s;
7_Bool t = &t;
Nuno Lopes83950812009-02-02 16:07:41 +00008
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