xref: /minix3/external/bsd/llvm/dist/clang/test/Parser/check_cast.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -fsyntax-only -verify %s
2*f4a2713aSLionel Sambuc struct foo {
3*f4a2713aSLionel Sambuc   int a;
4*f4a2713aSLionel Sambuc };
5*f4a2713aSLionel Sambuc 
main()6*f4a2713aSLionel Sambuc int main() {
7*f4a2713aSLionel Sambuc   struct foo xxx;
8*f4a2713aSLionel Sambuc   int i;
9*f4a2713aSLionel Sambuc 
10*f4a2713aSLionel Sambuc   xxx = (struct foo)1;  // expected-error {{used type 'struct foo' where arithmetic or pointer type is required}}
11*f4a2713aSLionel Sambuc   i = (int)xxx; // expected-error {{operand of type 'struct foo' where arithmetic or pointer type is required}}
12*f4a2713aSLionel Sambuc }
13