Add -Wunused-using, a warning that finds unused using declarations.
Also added an alias -Wunused-usings.
This patch uses a similar approach as the work done for the typedefs
as discussed in:
https://reviews.llvm.org/rC217298
It uses the 'referenced' available bit for the declarations.
For the below test:
namespace nsp { void foo(); } using foo;
A debug information entries are generated for the namespace
and for the using declaration.
In order to reduce the debug information for those specific cases,
the work is divided in 2 parts:
- Emit a warning for the unused using
- Do not generate debug information for the unused using
The current patch deals with the first part and it covers global
and local detection of unused using declarations.
Thanks for your view on this issue and on the general approach.
Note: This patch is dependent on
https://reviews.llvm.org/D46190
which is under review.