[PATCH] D137340: [clang-tidy] Add modernize-use-anonymous-namespace check

Carlos Galvez via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 3 14:02:47 PDT 2022


carlosgalvezp added a comment.

In D137340#3906250 <https://reviews.llvm.org/D137340#3906250>, @njames93 wrote:

> I'm not entirely sure why this belongs in the modernize module given anonymous namespaces have been in c++ forever, maybe its more of a misc check? Also the modernize checks are meant to actually emit fixes(ignore the c arrays check :) ), Right now, this only warn, it doesn't appear to act

Don't have a strong opinion, if you want I can move it there! I put in modernize as in "modernize from C-style into C++ style". But I know there's diverse opinions about this (LLVM not following this, for example) so perhaps it should be misc. Let me know which one you'd prefer so I can apply the change!

I didn't add fix because it would add quite some complexity, e.g. figuring out if there's is already an anon namespace to move into, or create a new one, users might want configurable behavior, etc.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137340/new/

https://reviews.llvm.org/D137340



More information about the cfe-commits mailing list