[clang] [clang] Extend -Wunused-but-set-variable to static globals (PR #178342)

Yanzuo Liu via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 19 01:14:13 PST 2026


================
@@ -141,6 +141,9 @@ Attribute Changes in Clang
 
 Improvements to Clang's diagnostics
 -----------------------------------
+- ``-Wunused-but-set-variable`` now diagnoses file-scope variables with
+  internal linkage (``static`` storage class) that are assigned but never used.
----------------
zwuis wrote:

Reference the issue fixed by this PR like other entries.

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


More information about the cfe-commits mailing list