[PATCH] D77461: [clang-tidy] Remove false positive in AvoidNonConstGlobalVariables
Dmitri Gribenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Apr 6 01:03:44 PDT 2020
gribozavr2 added a comment.
I expect different style guides to have a different opinion on this, depending on the justification for the rule.
> The purpose of the rule is to avoid code which causes hidden dependencies.
That's one justification, which would prohibit such static variables.
Another justification is to avoid "spooky action-at-a-distance" (one piece of code communicating with another piece of code through a global variable), which would allow such static variables, because they are encapsulated.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77461/new/
https://reviews.llvm.org/D77461
More information about the cfe-commits
mailing list