implicit-casts.c 435 B

123456789101112131415161718192021
  1. // RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
  2. _Complex double X;
  3. void test1(int c) {
  4. X = 5;
  5. }
  6. void test2() {
  7. int i;
  8. double d = i;
  9. double _Complex a = 5;
  10. test1(a);
  11. a = 5;
  12. d = i;
  13. }
  14. int test3() {
  15. int a[2];
  16. a[0] = test3; // expected-warning{{incompatible pointer to integer conversion assigning to 'int' from 'int ()'}}
  17. return 0;
  18. }
  19. short x; void test4(char c) { x += c; }
  20. int y; void test5(char c) { y += c; }