This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] fix a false positive of `cppcoreguidelines-avoid-non-const-global-variables`
AbandonedPublic

Authored by v1nh1shungry on Jan 16 2023, 3:53 AM.

Details

Summary

Currently this checker will report the non-const static
private/protected member of a class/struct.

Fixes https://github.com/llvm/llvm-project/issues/57919

Diff Detail

Event Timeline

v1nh1shungry created this revision.Jan 16 2023, 3:53 AM
Herald added a project: Restricted Project. · View Herald Transcript
v1nh1shungry requested review of this revision.Jan 16 2023, 3:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 16 2023, 3:53 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

I'm not convinced this is the correct fix.
The guildline states that tools should flag all variables declared at global or namespace scope.
Therefore we shouldn't be flagging any class static members, no matter if they are public, private or protected.

v1nh1shungry abandoned this revision.Jan 16 2023, 6:41 PM