2009-05-19 19:12:40 +08:00
|
|
|
// RUN: clang-cc -triple i386-pc-linux-gnu -fsyntax-only -verify %s
|
2009-02-22 14:45:27 +08:00
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2007-10-17 08:52:43 +08:00
|
|
|
static int f = 10;
|
2008-08-10 09:58:45 +08:00
|
|
|
static int b = f; // expected-error {{initializer element is not a compile-time constant}}
|
2008-05-31 02:14:48 +08:00
|
|
|
|
2009-05-01 10:23:58 +08:00
|
|
|
float r = (float) (intptr_t) &r; // expected-error {{initializer element is not a compile-time constant}}
|
2009-02-22 14:45:27 +08:00
|
|
|
intptr_t s = (intptr_t) &s;
|
2008-05-31 02:14:48 +08:00
|
|
|
_Bool t = &t;
|
2009-02-03 00:07:41 +08:00
|
|
|
|
|
|
|
|
|
|
|
union bar {
|
|
|
|
int i;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct foo {
|
|
|
|
unsigned ptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
union bar u[1];
|
2009-02-22 14:45:27 +08:00
|
|
|
struct foo x = {(intptr_t) u}; // no-error
|
2009-02-03 06:57:15 +08:00
|
|
|
struct foo y = {(char) u}; // expected-error {{initializer element is not a compile-time constant}}
|