Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / diagnostic / maybe_unused1.C
blob70a8ec937ddc4848d88fbf4f6e7fa7051150fb51
1 /* [dcl.attr.unused] The attribute may be applied to the declaration of a
2    class, a typedef-name, a variable (including a structured binding
3    declaration), a non-static data member, a function, an enumeration, or an
4    enumerator.  */
5 // { dg-do compile { target c++11 } }
6 // { dg-additional-options "-Wunused -Wextra" }
8 class [[maybe_unused]] Test {
9   [[maybe_unused]] int a_;
10   void b() {};
13 [[maybe_unused]] typedef Test Test2;
15 [[maybe_unused]] int i;
16 [[maybe_unused]] void f();
17 enum [[maybe_unused]] E { e [[maybe_unused]] = 42 };