1 // RUN: %clang_cc1 -fsyntax-only -Wunused -std=c2x -verify %s
3 struct [[maybe_unused
]] S1
{ // ok
4 int a
[[maybe_unused
]];
7 enum [[maybe_unused
]] E1
{
8 EnumVal
[[maybe_unused
]]
11 [[maybe_unused
]] void unused_func([[maybe_unused
]] int parm
) {
12 typedef int maybe_unused_int
[[maybe_unused
]];
13 [[maybe_unused
]] int I
;
17 int x
; // expected-warning {{unused variable}}
18 typedef int I
; // expected-warning {{unused typedef 'I'}}
20 // Should not warn about these due to not being used.
21 [[maybe_unused
]] int y
;
22 typedef int maybe_unused_int
[[maybe_unused
]];
24 // Should not warn about these uses.
26 maybe_unused_int test
;
31 [[maybe_unused
]] void f2(void);