Fix PR27429.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
clang-tidy/misc/UnusedUsingDeclsCheck.cpp | ||
---|---|---|
63 ↗ | (On Diff #56412) | Use early return here instead of "else". |
65 ↗ | (On Diff #56412) | No braces for single statement ifs. |
68 ↗ | (On Diff #56412) | Wouldn't you also want to do this via the canonical decl? Add a test. |
71 ↗ | (On Diff #56412) | Would it be important to look at something like the canonical decl here? Can you add a test with a (static) class variable that is initialized out of line? |
test/clang-tidy/misc-unused-using-decls.cpp | ||
60 ↗ | (On Diff #56412) | Can you add tests where variables and functions are solely referenced by pointers to members? Compare: |
I ran the check on LLVM project. The check found 8 hits: http://reviews.llvm.org/D20060 (Check all of them, no false positives).
clang-tidy/misc/UnusedUsingDeclsCheck.cpp | ||
---|---|---|
39 ↗ | (On Diff #56540) | We should also ignore using declarations in function context (Koenig lookup..). |
clang-tidy/misc/UnusedUsingDeclsCheck.h | ||
33 ↗ | (On Diff #56540) | nit: Add an empty line after this. |
test/clang-tidy/misc-unused-using-decls.cpp | ||
27 ↗ | (On Diff #56540) | Move this into the "Using declarations" section. |
Update.
clang-tidy/misc/UnusedUsingDeclsCheck.cpp | ||
---|---|---|
39 ↗ | (On Diff #56540) | If we ignore them in function context, we will also skip the following case: namespace a { class A {}; }; void func() { using a::A; // unused-using decls. } |