[PATCH] D45403: Make [[maybe_unused]] work with static data members
Roman Lebedev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Apr 7 03:53:30 PDT 2018
lebedev.ri added inline comments.
================
Comment at: test/CXX/dcl.dcl/dcl.attr/dcl.attr.unused/p2.cpp:5
int I [[maybe_unused]];
- static int SI [[maybe_unused]]; // expected-warning {{'maybe_unused' attribute only applies to variables, functions, methods, types, enumerations, enumerators, labels, and non-static data members}}
+ static int SI [[maybe_unused]];
};
----------------
As the code comment noted, http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4659.pdf, page 199:
```
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.
```
Repository:
rC Clang
https://reviews.llvm.org/D45403
More information about the cfe-commits
mailing list