Debian Codegraph @

gcc/testsuite/g++.dg/ext/pr116545.C

raw
1 // PR c/116545
2 // { dg-do compile }
3 // { dg-options "-Wall" }
4
5 void
6 foo (bool x)
7 {
8 [[]] __attribute__(()) [[]] __attribute__((assume (true))) [[]];
9 [[]] __attribute__(()) [[assume (true)]] __attribute__(()) [[]];
10 __attribute__(()) [[]] __attribute__((assume (true))) [[]] __attribute__(());
11 __attribute__(()) [[assume (true)]] __attribute__(()) [[]] __attribute__(());
12 if (__attribute__((assume (true))); x) // { dg-warning "init-statement in selection statements only available with" "" { target c++14_down } }
13 ;
14 }
15
16 void
17 bar (int x)
18 {
19 switch (x)
20 {
21 case 1:
22 ++x;
23 [[]] __attribute__(()) [[]] __attribute__((fallthrough)) [[]];
24 case 2:
25 ++x;
26 [[]] __attribute__(()) [[fallthrough]] __attribute__(()) [[]];
27 case 3:
28 ++x;
29 __attribute__(()) [[]] __attribute__((__fallthrough__)) [[]] __attribute__(());
30 case 4:
31 ++x;
32 __attribute__(()) [[fallthrough]] __attribute__(()) [[]] __attribute__(());
33 case 5:
34 ++x;
35 break;
36 default:
37 break;
38 }
39 }