2008-01-14 01:10:08 +08:00
|
|
|
// RUN: clang -fsyntax-only -verify -std=c90 %s
|
|
|
|
void
|
|
|
|
foo (void)
|
|
|
|
{
|
|
|
|
struct b;
|
|
|
|
struct b* x = 0;
|
|
|
|
struct b* y = &*x;
|
|
|
|
}
|
|
|
|
|
|
|
|
void foo2 (void)
|
|
|
|
{
|
|
|
|
typedef int (*arrayptr)[];
|
|
|
|
arrayptr x = 0;
|
|
|
|
arrayptr y = &*x;
|
|
|
|
}
|
|
|
|
|
|
|
|
void foo3 (void)
|
|
|
|
{
|
|
|
|
void* x = 0;
|
2008-02-10 09:39:04 +08:00
|
|
|
void* y = &*x; // expected-error{{address expression must be an lvalue or a function designator}}
|
2008-02-10 08:30:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
extern const void cv1;
|
|
|
|
const void *foo4 (void)
|
|
|
|
{
|
|
|
|
return &cv1;
|
2008-01-14 01:10:08 +08:00
|
|
|
}
|
|
|
|
|
2008-02-10 09:39:04 +08:00
|
|
|
extern void cv2;
|
|
|
|
void *foo5 (void)
|
|
|
|
{
|
|
|
|
return &cv2; // expected-error{{address expression must be an lvalue or a function designator}}
|
|
|
|
}
|