2018-04-09 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / gcc.dg / lvalue-6.c
blob6a847d947806a9e1575fbe844db84eaeee651c2d
1 /* Test constraints on unary '&': PR 22367. */
3 /* { dg-do compile } */
4 /* { dg-options "-std=iso9899:1990 -pedantic-errors" } */
6 extern void v;
7 void f1 (void) { &v; } /* { dg-error "taking address of expression of type 'void'" } */
9 extern void *pv;
10 void f2 (void) { &*pv; } /* { dg-warning "dereferencing" } */
11 /* { dg-error "taking address of expression of type 'void'" "C90 only error" { target *-*-* } .-1 } */
13 extern const void cv;
14 void f3 (void) { &cv; }
16 extern const void *pcv;
17 void f4 (void) { &*pcv; } /* { dg-warning "dereferencing" } */