Seo Sanghyeon | eff2cd5 | 2009-01-15 04:51:39 +0000 | [diff] [blame^] | 1 | // RUN: clang -fsyntax-only -verify -pedantic %s |
2 | |||||
3 | union u { int i; }; | ||||
4 | void f(union u); | ||||
5 | |||||
6 | void test(int x) { | ||||
7 | f((union u)x); // expected-warning {{C99 forbids casts to union type}} | ||||
8 | f((union u)&x); // expected-error {{cast to union type from type 'int *' not present in union}} | ||||
9 | } |