blob: fad56430a07fc0fe10b1d5195c633ae4b1b88856 [file] [log] [blame]
Daniel Dunbard7d5f022009-03-24 02:24:46 +00001// RUN: clang-cc -fsyntax-only -verify -std=c90 %s
Steve Naroff08f19672008-01-13 17:10:08 +00002void
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;
Steve Naroffa0992b62008-02-18 15:14:59 +000024
Steve Naroff75ceedf2008-02-10 00:30:18 +000025const void *foo4 (void)
26{
27 return &cv1;
Steve Naroff08f19672008-01-13 17:10:08 +000028}
29
Steve Naroffacb818a2008-02-10 01:39:04 +000030extern void cv2;
31void *foo5 (void)
32{
33 return &cv2; // expected-error{{address expression must be an lvalue or a function designator}}
34}
Steve Naroffa0992b62008-02-18 15:14:59 +000035
36typedef const void CVT;
37extern CVT cv3;
38
39const void *foo6 (void)
40{
41 return &cv3;
42}
43