[PATCH] D45403: Make [[maybe_unused]] work with static data members

2018-04-12 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman closed this revision. aaron.ballman added a comment. I've commit in r329904, thank you for the patch! https://reviews.llvm.org/D45403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D45403: Make [[maybe_unused]] work with static data members

2018-04-12 Thread S. B. Tam via Phabricator via cfe-commits
cpplearner added a comment. I do not have commit access. Could someone commit the change for me? https://reviews.llvm.org/D45403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D45403: Make [[maybe_unused]] work with static data members

2018-04-10 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman accepted this revision. aaron.ballman added a comment. This revision is now accepted and ready to land. LGTM! https://reviews.llvm.org/D45403 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D45403: Make [[maybe_unused]] work with static data members

2018-04-10 Thread S. B. Tam via Phabricator via cfe-commits
cpplearner updated this revision to Diff 141880. cpplearner added a comment. Removed `ExpectedForMaybeUnused` from AttributeList.h, and removed the entry for `ExpectedForMaybeUnused` from the `warn_attribute_wrong_decl_type` table definition. https://reviews.llvm.org/D45403 Files:

[PATCH] D45403: Make [[maybe_unused]] work with static data members

2018-04-10 Thread S. B. Tam via Phabricator via cfe-commits
cpplearner added a comment. In https://reviews.llvm.org/D45403#1062276, @aaron.ballman wrote: > I don't think we're currently diagnosing static data members of classes as > being unused in the first place; are there plans to implement that > functionality so that someone might want to write

[PATCH] D45403: Make [[maybe_unused]] work with static data members

2018-04-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:2054 - } - // If this is spelled as the standard C++17 attribute, but not in C++17, warn Quuxplusone wrote: > @aaron.ballman writes: > > I don't think we're currently diagnosing

[PATCH] D45403: Make [[maybe_unused]] work with static data members

2018-04-09 Thread Arthur O'Dwyer via Phabricator via cfe-commits
Quuxplusone added inline comments. Comment at: lib/Sema/SemaDeclAttr.cpp:2054 - } - // If this is spelled as the standard C++17 attribute, but not in C++17, warn @aaron.ballman writes: > I don't think we're currently diagnosing static data members of classes

[PATCH] D45403: Make [[maybe_unused]] work with static data members

2018-04-09 Thread Aaron Ballman via Phabricator via cfe-commits
aaron.ballman added a comment. I don't think we're currently diagnosing static data members of classes as being unused in the first place; are there plans to implement that functionality so that someone might want to write the attribute there? Comment at:

[PATCH] D45403: Make [[maybe_unused]] work with static data members

2018-04-07 Thread S. B. Tam via Phabricator via cfe-commits
cpplearner 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,

[PATCH] D45403: Make [[maybe_unused]] work with static data members

2018-04-07 Thread Roman Lebedev via Phabricator via cfe-commits
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,

[PATCH] D45403: Make [[maybe_unused]] work with static data members

2018-04-07 Thread S. B. Tam via Phabricator via cfe-commits
cpplearner created this revision. cpplearner added reviewers: aaron.ballman, rsmith. Herald added a subscriber: cfe-commits. IIUC a static data member is a variable, so [[maybe_unused]] should be allowed to apply to a static data member. Repository: rC Clang https://reviews.llvm.org/D45403