blob: 8f8156d81f70c7be223cf5a8bc382c0cbfa47834 [file] [log] [blame]
Steve Naroff08f19672008-01-13 17:10:08 +00001// RUN: clang -fsyntax-only -verify -std=c90 %s
2void
3foo (void)
4{
5 struct b;
6 struct b* x = 0;
7 struct b* y = &*x;
8}
9
10void foo2 (void)
11{
12 typedef int (*arrayptr)[];
13 arrayptr x = 0;
14 arrayptr y = &*x;
15}
16
17void foo3 (void)
18{
19 void* x = 0;
Steve Naroffacb818a2008-02-10 01:39:04 +000020 void* y = &*x; // expected-error{{address expression must be an lvalue or a function designator}}
Steve Naroff75ceedf2008-02-10 00:30:18 +000021}
22
23extern const void cv1;
24const void *foo4 (void)
25{
26 return &cv1;
Steve Naroff08f19672008-01-13 17:10:08 +000027}
28
Steve Naroffacb818a2008-02-10 01:39:04 +000029extern void cv2;
30void *foo5 (void)
31{
32 return &cv2; // expected-error{{address expression must be an lvalue or a function designator}}
33}