This is an archive of the discontinued LLVM Phabricator instance.

.clang-tidy: disable misc-use-anonymous-namespace check.
Needs ReviewPublic

Authored by hokein on Dec 22 2022, 1:36 AM.

Details

Summary

The check gives warnings on static functions, this is allowed per LLVM
code style https://llvm.org/docs/CodingStandards.html#anonymous-namespaces

Diff Detail

Event Timeline

hokein created this revision.Dec 22 2022, 1:36 AM
Herald added a project: Restricted Project. · View Herald Transcript
hokein requested review of this revision.Dec 22 2022, 1:36 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2022, 1:36 AM

Yeah, good call. Do you mind if I first use this as a trigger to start a thread about this style rule on discourse, though? I've been meaning to, it came up in a review recently.

I think there's a fair chance of changing the policy from "require static" to "allow either" or "require anon namespace", and having the issue "live" in clang-tidy might make for a more engaged discussion.

hokein added a comment.Jan 2 2023, 4:08 AM

Yeah, good call. Do you mind if I first use this as a trigger to start a thread about this style rule on discourse, though? I've been meaning to, it came up in a review recently.

sure, please go ahead. (I found that these warnings are annoying when editing the llvm code file).

I think there's a fair chance of changing the policy from "require static" to "allow either" or "require anon namespace", and having the issue "live" in clang-tidy might make for a more engaged discussion.

Yeah, the code style says require static, I think in practice we allow either.