annotate gcc/testsuite/g++.dg/cpp0x/gen-attrs-53.C @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 // { dg-do compile { target c++11 } }
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 int
kono
parents:
diff changeset
4 toto ()
kono
parents:
diff changeset
5 {
kono
parents:
diff changeset
6 [[gnu::unused]] good:
kono
parents:
diff changeset
7 return 0;
kono
parents:
diff changeset
8 }
kono
parents:
diff changeset
9
kono
parents:
diff changeset
10 int
kono
parents:
diff changeset
11 foo ()
kono
parents:
diff changeset
12 {
kono
parents:
diff changeset
13 [[gnu::unused]] good:
kono
parents:
diff changeset
14 int i = 0;
kono
parents:
diff changeset
15
kono
parents:
diff changeset
16 // A C++11 attribute at the beginning of the return statement is
kono
parents:
diff changeset
17 // syntactically correct, appertains to the return statement (not to
kono
parents:
diff changeset
18 // the label) but is currently ignored by this implementation.
kono
parents:
diff changeset
19 good_ignored : [[gnu::unused]] // { dg-warning "attributes at the beginning of statement are ignored" }
kono
parents:
diff changeset
20 return i;
kono
parents:
diff changeset
21 }
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 int
kono
parents:
diff changeset
24 bar ()
kono
parents:
diff changeset
25 {
kono
parents:
diff changeset
26 // A GNU attribute after the label appertains to the label.
kono
parents:
diff changeset
27 good: __attribute__((unused));
kono
parents:
diff changeset
28 return 0;
kono
parents:
diff changeset
29 }
kono
parents:
diff changeset
30
kono
parents:
diff changeset
31 int
kono
parents:
diff changeset
32 baz ()
kono
parents:
diff changeset
33 {
kono
parents:
diff changeset
34 // The c++ attribute after the label appertains to the (empty)
kono
parents:
diff changeset
35 // statement.
kono
parents:
diff changeset
36 bad: [[gnu::unused]]; // { dg-warning "attributes at the beginning of statement are ignored" }
kono
parents:
diff changeset
37 return 0;
kono
parents:
diff changeset
38 }
kono
parents:
diff changeset
39