This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy] Fix nested namespaces in `readability-static-definition-in-anonymous-namespace` check
ClosedPublic

Authored by Izaron on Jan 23 2022, 2:55 PM.

Details

Summary

The check previously inspected only the immediate parent namespace.
static in a named namespace within an unnamed namespace is still redundant.
We will use Decl::isInAnonymousNamespace() method that traverses the
namespaces hierarchy recursively.

Diff Detail

Event Timeline

Izaron created this revision.Jan 23 2022, 2:55 PM
Izaron requested review of this revision.Jan 23 2022, 2:55 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 23 2022, 2:55 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
This revision is now accepted and ready to land.Jan 26 2022, 1:14 PM

If there is an open github issue on this, please put "Fixes #nnnn" in the commit description before pushing.

If there is an open github issue on this, please put "Fixes #nnnn" in the commit description before pushing.

Thanks! I didn't file a github issue. Just searched on github - no one else did it either.

I don't have commit access, so this review could be commited by someone else if that's okay.
If someone is willing to do it, kindly please do it on my behalf =) My name is Evgeny Shulgin, email izaronplatz@gmail.com