2 /* { dg-do compile } */
3 /* { dg-options "-Wduplicate-decl-specifier" } */
7 typedef volatile int VT1
;
8 #define VT2 volatile int
9 typedef char *restrict RT1
;
10 #define RT2 char *restrict
19 const int const x5
; /* { dg-warning "duplicate .const." } */
25 volatile int volatile y5
; /* { dg-warning "duplicate .volatile." } */
26 volatile int *volatile y6
;
30 /* "restrict RT2" is invalid */
31 char *restrict restrict r4
; /* { dg-warning "duplicate .restrict." } */
32 char *restrict
*restrict r5
;
35 void c1(const CT1 t
) { }
36 void c2(const CT2 t
) { }
37 void c3(CT1
const t
) { }
38 void c4(CT2
const t
) { }
39 void c5(const int const t
) { } /* { dg-warning "duplicate .const." } */
40 void v1(volatile VT1 t
) { }
41 void v2(volatile VT2 t
) { }
42 void v3(VT1
volatile t
) { }
43 void v4(VT2
volatile t
) { }
44 void v5(volatile int volatile t
) { } /* { dg-warning "duplicate .volatile." } */
45 void r1(restrict RT1 t
) { }
46 void r2(RT1 restrict t
) { }
47 void r3(RT2 restrict t
) { }
48 void r4(char *restrict restrict t
) { } /* { dg-warning "duplicate .restrict." } */
50 typedef const CT1 CCT1
;
51 typedef const CT2 CCT2
;
52 typedef CT1
const CT1C
;
53 typedef CT2
const CT2C
;
54 typedef const int const CIC
; /* { dg-warning "duplicate .const." } */
55 typedef volatile VT1 VVT1
;
56 typedef volatile VT2 VVT2
;
57 typedef VT1
volatile VT1V
;
58 typedef VT2
volatile VT2V
;
59 typedef volatile int volatile VIV
; /* { dg-warning "duplicate .volatile." } */
60 typedef RT1 restrict RT1R
;
61 typedef RT2 restrict RT2R
;
62 typedef restrict RT1 RRT1
;
63 typedef int *restrict restrict IRR
; /* { dg-warning "duplicate .restrict." } */