[clang] [Clang][NFCI] Enforce immutability of global strings (PR #183287)

Steffen Larsen via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 26 00:27:57 PST 2026


================
@@ -57,7 +57,7 @@ inline raw_ostream &Indent(raw_ostream &o, const unsigned indent) {
 }
 
 inline raw_ostream &EmitPlistHeader(raw_ostream &o) {
-  static const char *PlistHeader =
+  constexpr char PlistHeader[] =
----------------
steffenlarsen wrote:

Good point! I have made the singular pointers a `const char *` instead and the arrays have been made `static constexpr` instead.

https://github.com/llvm/llvm-project/pull/183287


More information about the cfe-commits mailing list