aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp1z/maybe_unused1.C
blob: eb8b51e8c04790cc4b8ed6b19de52970c3d61163 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// { dg-do compile { target c++11 } }
// { dg-options "-Wunused -Wextra" }

[[maybe_unused]] static void f() { }

enum [[maybe_unused]] E {
  e [[maybe_unused]]
};

struct [[maybe_unused]] A {
  [[maybe_unused]] static int i;
};

void g([[maybe_unused]] int i) {
  [[maybe_unused]] typedef int T;
  [[maybe_unused]] int j;
}