This is an archive of the discontinued LLVM Phabricator instance.

Add -misc-use-anonymous-namespace to .clang-tidy
ClosedPublic

Authored by barannikov88 on May 2 2023, 10:13 AM.

Details

Summary

This is at odds with the coding standard.
Quoting https://llvm.org/docs/CodingStandards.html#anonymous-namespaces

Because of this, we have a simple guideline: make anonymous namespaces
as small as possible, and only use them for class declarations.

Diff Detail

Event Timeline

barannikov88 created this revision.May 2 2023, 10:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2023, 10:13 AM
barannikov88 requested review of this revision.May 2 2023, 10:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 2 2023, 10:13 AM
barannikov88 edited the summary of this revision. (Show Details)
MaskRay accepted this revision.May 5 2023, 4:14 PM
MaskRay added inline comments.
.clang-tidy
1

Move before -misc-no-recursion for an alphabetical order.

This revision is now accepted and ready to land.May 5 2023, 4:14 PM
barannikov88 added a comment.EditedMay 5 2023, 4:18 PM

@MaskRay Do you mean that 'no-' and/or 'use-' should be ignored for the purpose of lexicographical comparison? (I don't mind, just in case.)

@MaskRay Do you mean that 'no-' and/or 'use-' should be ignored for the purpose of lexicographical comparison? (I don't mind, just in case.)

Ah, sorry. I think your order is correct.

I agree that our coding style is contrary to misc-use-anonymous-namespace and should not use misc-use-anonymous-namespace.

This revision was automatically updated to reflect the committed changes.