111
|
1 /* Test qualifiers on function return types after DR#423: those
|
|
2 qualifiers are now ignored for all purposes (but _Atomic is not,
|
|
3 for this purpose, a qualifier). */
|
|
4 /* { dg-do compile } */
|
|
5 /* { dg-options "-std=c11 -pedantic-errors" } */
|
|
6
|
|
7 int f1 (void);
|
|
8 const int f1 (void);
|
|
9 volatile int f1 (void) { return 0; }
|
|
10
|
|
11 int *restrict f2 (void) { return 0; }
|
|
12 int *f2 (void);
|
|
13
|
|
14 const volatile long f3 (void);
|
|
15 long f3 (void);
|
|
16
|
|
17 const volatile void f4 (void) { }
|
|
18 void f4 (void);
|
|
19
|
|
20 _Atomic int f5 (void); /* { dg-message "previous declaration" } */
|
|
21 int f5 (void); /* { dg-error "conflicting" } */
|
|
22
|
|
23 int f6 (void); /* { dg-message "previous declaration" } */
|
|
24 _Atomic int f6 (void) { return 0; } /* { dg-error "conflicting" } */
|
|
25
|
|
26 /* The standard seems unclear regarding the case where restrict is
|
|
27 applied to a function return type that may not be
|
|
28 restrict-qualified; assume here that it is disallowed. */
|
|
29 restrict int f7 (void); /* { dg-error "restrict" } */
|
|
30
|
|
31 typedef void FT (void);
|
|
32 FT *restrict f8 (void); /* { dg-error "restrict" } */
|