This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix template agrument false positives in unused-using-decls.
ClosedPublic

Authored by hokein on Oct 10 2016, 9:44 AM.

Details

Summary
  • Fix a false postive when an using class is used in an explicit template instantiation.
  • Fix a false postive when an using template class is used as template argument.

Diff Detail

Repository
rL LLVM

Event Timeline

hokein updated this revision to Diff 74139.Oct 10 2016, 9:44 AM
hokein retitled this revision from to [clang-tidy] Fix template agrument false positives in unused-using-decls..
hokein updated this object.
hokein added a subscriber: cfe-commits.
aaron.ballman added inline comments.Oct 10 2016, 2:06 PM
test/clang-tidy/misc-unused-using-decls.cpp
191 ↗(On Diff #74139)

Can you add a test using a non-type template argument, like an integer literal? I believe that still causes the diagnostic, though do we want it to?

hokein updated this revision to Diff 74221.Oct 11 2016, 3:45 AM

Add FIXME.

test/clang-tidy/misc-unused-using-decls.cpp
191 ↗(On Diff #74139)

Yeah, I agree that we need support non-type template arguments in the long term, but it seems out of scope of this patch (Supporting all non-type template arguments needs more stuff), I have added to FIXME.

aaron.ballman added inline comments.Oct 11 2016, 5:34 AM
test/clang-tidy/misc-unused-using-decls.cpp
191 ↗(On Diff #74139)

Certainly; I would mostly like a test showing that we considered it and understand the current behavior. If the test has a FIXME comment with it, that's also totally fine.

hokein updated this revision to Diff 74239.Oct 11 2016, 6:18 AM

Add a non-type template argument test.

hokein marked an inline comment as done.Oct 11 2016, 6:23 AM
aaron.ballman accepted this revision.Oct 11 2016, 6:39 AM
aaron.ballman edited edge metadata.

LGTM, thank you!

This revision is now accepted and ready to land.Oct 11 2016, 6:39 AM
This revision was automatically updated to reflect the committed changes.