1 /* { dg-do compile } */
3 /* No special options--in particular, turn off the default
4 -pedantic-errors option. */
5 /* { dg-options "" } */
7 /* When not using -fplan9-extensions, we don't support automatic
8 conversion of pointer types, and we don't support referring to a
9 typedef name directly. */
11 extern void exit (int);
12 extern void abort (void);
18 struct A
; /* { dg-warning "does not declare anything" } */
23 f1 (struct A
*p
) /* { dg-message "expected" } */
36 f1 (&b
); /* { dg-warning "incompatible pointer type" } */
37 if (b
.a
!= 1) /* { dg-error "no member" } */
39 if (b
.b
!= 2 || b
.c
!= 3)
41 p
= &b
; /* { dg-warning "incompatible pointer type" } */
46 typedef struct { char d
; } D
;
50 struct F
{ char f
; }; /* { dg-warning "does not declare anything" } */
53 D
; /* { dg-warning "does not declare anything" } */
59 f2 (struct F
*p
) /* { dg-message "expected" } */
65 f3 (D
*p
) /* { dg-message "expected" } */
86 f2 (&e
); /* { dg-warning "incompatible pointer type" } */
87 f3 (&e
); /* { dg-warning "incompatible pointer type" } */
88 if (e
.d
!= 4) /* { dg-error "no member" } */
90 if (e
.f
!= 6) /* { dg-error "no member" } */
92 if (e
.b
!= 2 || e
.c
!= 3 || e
.e
!= 5)
94 pf
= &e
; /* { dg-warning "incompatible pointer type" } */
97 pd
= &e
; /* { dg-warning "incompatible pointer type" } */
100 d
= e
.D
; /* { dg-error "no member" } */
101 f3 (&e
.D
); /* { dg-error "no member" } */
102 f4 (e
.D
); /* { dg-error "no member" } */