[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-06-01 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:282-290 +def warn_unused_using_declaration : Warning< + "unused using declaration %0">, + InGroup, DefaultIgnore; +def warn_unused_using_directive : Warning< + "unused using

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-06-01 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:282-290 +def warn_unused_using_declaration : Warning< + "unused using declaration %0">, + InGroup, DefaultIgnore; +def warn_unused_using_directive : Warning< + "unused using directive

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-06-01 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added a comment. Thanks to all reviewers for your comments and suggestions. https://reviews.llvm.org/D44826 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-06-01 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso updated this revision to Diff 149425. CarlosAlbertoEnciso marked 3 inline comments as done. CarlosAlbertoEnciso added a comment. Address feedback from @thakis in relation to the Release Notes. https://reviews.llvm.org/D44826 Files: docs/ReleaseNotes.rst

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-06-01 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added inline comments. Comment at: docs/ReleaseNotes.rst:139 + used in conjunction with ``-Werror`` and as a result, the new warnings + are turned into new errors. + thakis wrote: > nit: I'd omit this paragraph -- this is true for all

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-05-31 Thread Nico Weber via Phabricator via cfe-commits
thakis accepted this revision. thakis added a comment. This revision is now accepted and ready to land. Looks great. Comment at: docs/ReleaseNotes.rst:126 +namespace n { class C; } +using n::C; // Never actually used. + Maybe include an example with a

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-05-31 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso updated this revision to Diff 149261. CarlosAlbertoEnciso added a comment. This patch addresses the reviewers comments: - Additional test cases to cover: -Wunused, -Wall and -Wno-unused-using - Formatting in ReleaseNotes - Removed the '-Wunused-usings' alias (GCC

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-05-29 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added inline comments. Comment at: include/clang/Basic/DiagnosticGroups.td:828-829 // -Wunused-local-typedefs = -Wunused-local-typedef +def : DiagGroup<"unused-usings", [UnusedUsing]>; +// -Wunused-usings = -Wunused-using

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-05-26 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso marked 2 inline comments as done. CarlosAlbertoEnciso added a comment. @lebedev.ri, Thanks very much for your review. I will address those issues and update the patch. https://reviews.llvm.org/D44826 ___ cfe-commits mailing

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-05-25 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. Please improve test coverage a bit. `-Wunused-using` is part of `-Wunused`. And `-Wunused` is part of `-Wall`. That needs to be tested. Also, one small test to show that it is not on by default, and `-Wno-unused-using` actually disables it is needed.

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-05-25 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso marked 2 inline comments as done. CarlosAlbertoEnciso added inline comments. Comment at: lib/Serialization/ASTReader.cpp:8101-8103 +UsingDecl *D = dyn_cast_or_null( +GetDecl(UnusedUsingCandidates[I])); +if (D) dblaikie wrote:

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-05-25 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso updated this revision to Diff 148578. CarlosAlbertoEnciso edited the summary of this revision. CarlosAlbertoEnciso added a comment. This patch addresses the reviewers comments: 1. Merge the -Wunused-local-typedefs and -Wunused-usings implementations 2. Update the Release

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-03-29 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added a comment. @dblaikie, Thanks for your feedback and questions. I will address them. Currently I am looking with more detail the tracking of the 'used' and 'referenced' bits. Repository: rC Clang https://reviews.llvm.org/D44826

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-03-27 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment. You mention a missed case in the description - where the target of a using decl is used and that causes the unused-using not to warn about the using decl? That seems like a big limitation. Does that mean the 'used' bit is being tracked in the wrong place, on the

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-03-27 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added a comment. In https://reviews.llvm.org/D44826#1046906, @dblaikie wrote: > First of all, thanks very much for your feedback. > While implementing the warning is great (wonder if there's any codebase > that isn't -Wunused-using clean, that we could use to compare

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-03-26 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added a comment. In https://reviews.llvm.org/D44826#1046913, @Eugene.Zelenko wrote: > Please also mention new warning in Release Notes and documentation. I will do it. > Will this warning be part of -Wall or -Wextra? The warning is part of -Wall Thanks for your feedback.

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-03-26 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added a comment. In https://reviews.llvm.org/D44826#1046910, @Eugene.Zelenko wrote: > This duplicates Clang-tidy misc-unused-using-decls > . > If Clang will provide same or better functionality, it

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-03-23 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. Please also mention new warning in Release Notes and documentation. Will this warning be part of -Wall or -Wextra? Repository: rC Clang https://reviews.llvm.org/D44826 ___ cfe-commits mailing list

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-03-23 Thread Eugene Zelenko via Phabricator via cfe-commits
Eugene.Zelenko added a comment. This duplicates Clang-tidy misc-unused-using-decls . If Clang will provide same or better functionality, it should be removed. Repository: rC Clang https://reviews.llvm.org/D44826

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-03-23 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a subscriber: CarlosAlbertoEnciso. dblaikie added a comment. While implementing the warning is great (wonder if there's any codebase that isn't -Wunused-using clean, that we could use to compare Clang and GCC's behavior broadly - make sure it's catching the same cases (or

Re: [PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-03-23 Thread David Blaikie via cfe-commits
While implementing the warning is great (wonder if there's any codebase that isn't -Wunused-using clean, that we could use to compare Clang and GCC's behavior broadly - make sure it's catching the same cases (or justify/investigate differences)) - and using it to motivate the debug info is an

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-03-23 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso added a comment. In https://reviews.llvm.org/D44826#1046671, @erichkeane wrote: > My opinion matters less than @rsmith or @dblaikie on the review, but it seems > to me that Typedef and Using are SO similar that the implementations should > just be combined. You'd likely

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-03-23 Thread Erich Keane via Phabricator via cfe-commits
erichkeane added a comment. My opinion matters less than @rsmith or @dblaikie on the review, but it seems to me that Typedef and Using are SO similar that the implementations should just be combined. You'd likely have to change a couple of types along the way to be more generic, but the

[PATCH] D44826: Add -Wunused-using, a warning that finds unused using declarations.

2018-03-23 Thread Carlos Alberto Enciso via Phabricator via cfe-commits
CarlosAlbertoEnciso created this revision. CarlosAlbertoEnciso added reviewers: rsmith, erichkeane, probinson, dblaikie. CarlosAlbertoEnciso added a project: clang. Herald added subscribers: cfe-commits, JDevlieghere, aprantl. Add -Wunused-using, a warning that finds unused using declarations.