[PATCH] D139197: Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. Ah, then it has the exact same functionality! My idea for readability-redundant-static was to warn about: - static in anonymous namespace - static const/constexpr at global scope (since const gives implicit internal linkage in C++). I will see what I can do about

[PATCH] D139197: Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. I was commenting because we already have a similar diagnostic in clang-tidy 15: namespace { static void foo(); static void bar(){} void foo() {} static int x; } $ clang-tidy-15 -checks=\*,-llvmlibc-* /tmp/test.cpp Error while trying to load a

[PATCH] D139197: Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. My plan was to apply this removal in the same patch where I add the new check, but I know I'd get comments like "please do the removal in a separate patch". So that's what I'm doing :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

[PATCH] D139197: Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp added a comment. In D139197#3966549 , @lebedev.ri wrote: > This patch should not land before that one does. The original code is 1 day old. Do we really need to be so strict? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D139197: Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Roman Lebedev via Phabricator via cfe-commits
lebedev.ri added a comment. This patch should not land before that one does. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139197/new/ https://reviews.llvm.org/D139197 ___ cfe-commits mailing list cfe-co

[PATCH] D139197: Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp updated this revision to Diff 479616. carlosgalvezp added a comment. Reorder matchers to reduce diff. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D139197/new/ https://reviews.llvm.org/D139197 Files: clang-tools-extra/clang-tidy/mi

[PATCH] D139197: Do not warn about redundant static in misc-use-anonymous-namespace

2022-12-02 Thread Carlos Galvez via Phabricator via cfe-commits
carlosgalvezp created this revision. Herald added a reviewer: njames93. Herald added a project: All. carlosgalvezp requested review of this revision. Herald added a project: clang-tools-extra. Herald added a subscriber: cfe-commits. I will create a new check "readability-redundant-static" where th