xref: /minix3/external/bsd/llvm/dist/clang/test/Sema/cast-incomplete.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1 // RUN: %clang_cc1 -fsyntax-only %s -verify
2 // PR5692
3 
4 enum x;            // expected-note   {{forward declaration}}
5 extern struct y a; // expected-note   {{forward declaration}}
6 extern union z b;  // expected-note 2 {{forward declaration}}
7 
foo()8 void foo() {
9   (enum x)1;   // expected-error {{cast to incomplete type}}
10   (struct y)a; // expected-error {{cast to incomplete type}}
11   (union z)b;  // expected-error {{cast to incomplete type}}
12   (union z)1;  // expected-error {{cast to incomplete type}}
13 }
14 
15