1 .. title:: clang-tidy - readability-redundant-declaration
3 readability-redundant-declaration
4 =================================
6 Finds redundant variable and function declarations.
19 Such redundant declarations can be removed without changing program behavior.
20 They can for instance be unintentional left overs from previous refactorings
21 when code has been moved around. Having redundant declarations could in worst
22 case mean that there are typos in the code that cause bugs.
24 Normally the code can be automatically fixed, :program:`clang-tidy` can remove
25 the second declaration. However there are 2 cases when you need to fix the code
28 * When the declarations are in different header files;
29 * When multiple variables are declared together.
34 .. option:: IgnoreMacros
36 If set to `true`, the check will not give warnings inside macros. Default