member-reference.c 382 B

123456789101112131415161718192021222324
  1. // RUN: %clang_cc1 %s -verify -fsyntax-only
  2. struct simple { int i; };
  3. void f(void) {
  4. struct simple s[1];
  5. s->i = 1;
  6. }
  7. typedef int x;
  8. struct S {
  9. int x;
  10. x z;
  11. };
  12. void g(void) {
  13. struct S s[1];
  14. s->x = 1;
  15. s->z = 2;
  16. }
  17. int PR17762(struct simple c) {
  18. return c->i; // expected-error {{member reference type 'struct simple' is not a pointer; did you mean to use '.'?}}
  19. }