Daniel Dunbar | 8fbe78f | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -verify -fsyntax-only |
Steve Naroff | eaaae46 | 2007-12-16 21:42:28 +0000 | [diff] [blame] | 2 | |
| 3 | struct simple { int i; }; |
| 4 | |
| 5 | void f(void) { |
| 6 | struct simple s[1]; |
| 7 | s->i = 1; |
| 8 | } |
| 9 | |
Douglas Gregor | 82ac25e | 2009-01-08 20:45:30 +0000 | [diff] [blame] | 10 | typedef int x; |
| 11 | struct S { |
| 12 | int x; |
| 13 | x z; |
| 14 | }; |
| 15 | |
| 16 | void g(void) { |
| 17 | struct S s[1]; |
| 18 | s->x = 1; |
| 19 | s->z = 2; |
| 20 | } |
Kaelyn Uhrain | bd6ddaa | 2013-10-31 20:32:56 +0000 | [diff] [blame] | 21 | |
| 22 | int PR17762(struct simple c) { |
| 23 | return c->i; // expected-error {{member reference type 'struct simple' is not a pointer; maybe you meant to use '.'?}} |
| 24 | } |