[Clang-tidy] Why is there no warning when I use the redundant-declaration option?
When I declare two variables, there is no warning. When I extern, there is a warning. This is different from gcc. Is this some kind of special consideration?
https://godbolt.org/z/9rePocxo3
Because check is for declarations, and "int x" is a definition. And definitions are explicitly excluded in check.
Because check is for declarations, and "int x" is a definition. And definitions are explicitly excluded in check.
Why does the GCC have check?
Because check is for declarations, and "int x" is a definition. And definitions are explicitly excluded in check.
Why does the GCC have check?
Well, in theory every definition is also a declaration. But that's more a question to GCC devs. For me this check should be implemented as an compiler warning to match GCC, but initial idea were to match only declarations.
Because check is for declarations, and "int x" is a definition. And definitions are explicitly excluded in check.
Why does the GCC have check?
Well, in theory every definition is also a declaration. But that's more a question to GCC devs. For me this check should be implemented as an compiler warning to match GCC, but initial idea were to match only declarations.
I think you are right