This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 110b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
[Accepted as a DR at the February, 2019 meeting.]
According to9.12.8 [dcl.attr.unused] paragraph 2,
The attribute may be applied to the declaration of a class, a typedef-name, a variable, a non-static data member, a function, an enumeration, or an enumerator.
This does not include structured bindings, although there seems to be no good reason to prohibit uses like
[[maybe_unused]] auto [a, b] = std::make_pair(42, 0.23);
Notes from the October, 2018 teleconference:
CWG agreed that such an annotation should be permitted and apply to the underlying variable; i.e., a compiler might warn in the absence of such an attribute if none of the structured bindings were used, and the presence of the attribute would silence such warnings.
Proposed resolution (November, 2018):
Change 9.12.8 [dcl.attr.unused] paragraphs 2 and 3 as follows:
The attribute may be applied to the declaration of a class, a typedef-name, a variable , a non-static data member, a function, an enumeration, or an enumerator.
[Note:For an entity marked maybe_unused, implementations should not emit a warning that the entity isunused , or that the entity is used despite the presence of the attribute. —end note]