Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/gen-attrs-68.C

raw
1 // PR c++/81429 - wrong parsing of constructor with C++11 attribute.
2 // { dg-do compile { target c++11 } }
3 // { dg-additional-options "-Wunused-parameter -Wno-pedantic" }
4
5 void fn1([[maybe_unused]] int a) { }
6 void fn2(int a [[maybe_unused]]) { }
7 void fn3(__attribute__((unused)) int a) { }
8 void fn4(int a __attribute__((unused))) { }
9
10 struct S1 {
11 S1([[maybe_unused]] int a) { }
12 };
13
14 struct S2 {
15 S2([[maybe_unused]] int f, [[maybe_unused]] int a) { }
16 };
17
18 struct S3 {
19 S3(int a [[maybe_unused]]) { }
20 };
21
22 struct S4 {
23 S4(int f [[maybe_unused]], int a [[maybe_unused]]) { }
24 };
25
26 struct S5 {
27 S5(__attribute__((unused)) int a) { }
28 };
29
30 struct S6 {
31 S6(__attribute__((unused)) int f, __attribute__((unused)) int a) { }
32 };
33
34 struct S7 {
35 S7(int a __attribute__((unused))) { }
36 };
37
38 struct S8 {
39 S8(int f __attribute__((unused)), int a __attribute__((unused))) { }
40 };