check_cast.c 339 B

123456789101112
  1. // RUN: %clang_cc1 -fsyntax-only -verify %s
  2. struct foo {
  3. int a;
  4. };
  5. int main() {
  6. struct foo xxx;
  7. int i;
  8. xxx = (struct foo)1; // expected-error {{used type 'struct foo' where arithmetic or pointer type is required}}
  9. i = (int)xxx; // expected-error {{operand of type 'struct foo' where arithmetic or pointer type is required}}
  10. }