OSDN Git Service

2010-12-09 Richard Guenther <rguenther@suse.de>
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / gcc.c-torture / compile / pr46866.c
1 extern void *malloc(__SIZE_TYPE__);
2 typedef struct T T;
3 struct T {
4     void (*destroy)(void *);
5 };
6 void destroy(union { void *this; } __attribute__((transparent_union)));
7 static const typeof(destroy) *_destroy  = (const typeof(destroy)*)destroy;
8 void destroy(void *this);
9 static T *create_empty(void)
10 {
11   T *this = malloc(sizeof(*this));
12   *this = (typeof(*this)){ _destroy };
13   return this;
14 }
15 void openssl_crl_load(void)
16 {
17   T *this = create_empty();
18   destroy(this);
19 }