[clang-tools-extra] [clang-tidy][NFC] Prefer `static constexpr` over `static const` where possible (PR #173406)
Carlos Galvez via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 23 12:05:47 PST 2025
================
@@ -18,7 +18,7 @@ using namespace clang::ast_matchers;
namespace clang::tidy::modernize {
-static const char SpecialFunction[] = "SpecialFunction";
+static constexpr char SpecialFunction[] = "SpecialFunction";
----------------
carlosgalvezp wrote:
Off topic: constant/variables that are just a literal copy of their contents is a bit of an antipattern, since they need to change name anytime the contents change. One might as well just use the literal string where needed instead.
https://github.com/llvm/llvm-project/pull/173406
More information about the cfe-commits
mailing list