Debian Codegraph @

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

raw
1 // PR c++/69585
2 // { dg-do compile { target c++11 } }
3 // Test mixing the GNU and standard forms of attributes.
4
5 __attribute__((deprecated)) [[maybe_unused]] void f1 ();
6 [[maybe_unused]] __attribute__((deprecated)) void f2 ();
7 [[maybe_unused]] __attribute__((deprecated)) [[nodiscard]] int f3 ();
8 __attribute__((unused)) [[nodiscard]] __attribute__((deprecated)) int f4 ();
9
10 struct [[maybe_unused]] __attribute__((aligned)) S1 { double d; };
11 struct __attribute__((aligned)) [[maybe_unused]] S2 { double d; };
12
13 enum E {
14 X [[maybe_unused]] __attribute__((unavailable)),
15 Y __attribute__((unavailable)) [[maybe_unused]],
16 };
17
18 void
19 g ([[maybe_unused]] __attribute__((unavailable)) int i1,
20 __attribute__((unavailable)) [[maybe_unused]] int i2)
21 {
22 [[maybe_unused]] __attribute__((aligned)) int i3;
23 __attribute__((aligned)) [[maybe_unused]] int i4;
24
25 [[maybe_unused]]
26 lab: __attribute__((cold));
27 }