Open Quuxplusone opened 8 years ago
To double-check. Here's the situation:
a.h (known to be a system header to clang):
namespace x { ... }
b.cpp:
#include "a.h"
namespace x {
class A;
}
Do you want the check to ignore naming style violations in namespace x in file
b.cpp (e.g. x::A)?
There's one little issue with this approach: what if the "std" namespace, for
example, is used in a user header that happens to be included first?
Do you want the check to ignore naming style violations in namespace x in file b.cpp (e.g. x::A)?
Yes.
There's one little issue with this approach: what if the "std" namespace, for example, is used in a user header that happens to be included first?
I'd argue that this situation is not common, but clang-tidy cannot do anything about this anyways.
I still would like clang-tidy to recognize this when it can though.
When reopening namespaces of system/thirdparty libraries (like std) in my own code, the check readability-identifier-naming complains if they do not follow the same convention as my code.
Since this happens often, and typically one cannot do anything about it, the sane thing should be to not complain on namespaces that are "viewed" for the first time in system headers.