https://github.com/jpjepko updated 
https://github.com/llvm/llvm-project/pull/179790

>From a402efdefed48cbe72282969de52d44946c26b7d Mon Sep 17 00:00:00 2001
From: John Jepko <[email protected]>
Date: Wed, 4 Feb 2026 17:41:24 +0100
Subject: [PATCH 1/2] add Wused-but-marked-unused to Wattributes

---
 clang/include/clang/Basic/DiagnosticGroups.td | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/clang/include/clang/Basic/DiagnosticGroups.td 
b/clang/include/clang/Basic/DiagnosticGroups.td
index 488f3a94c4fb6..cf2bc00cc2e21 100644
--- a/clang/include/clang/Basic/DiagnosticGroups.td
+++ b/clang/include/clang/Basic/DiagnosticGroups.td
@@ -1010,8 +1010,9 @@ def IndependentClassAttribute : 
DiagGroup<"IndependentClass-attribute">;
 def UnknownAttributes : DiagGroup<"unknown-attributes">;
 def IgnoredAttributes : DiagGroup<"ignored-attributes",
                                   [DllexportExplicitInstantiation]>;
-def Attributes : DiagGroup<"attributes", [UnknownAttributes,
-                                          IgnoredAttributes]>;
+def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">;
+def Attributes : DiagGroup<"attributes", [UnknownAttributes, IgnoredAttributes,
+                                          UsedButMarkedUnused]>;
 def UnknownSanitizers : DiagGroup<"unknown-sanitizers">;
 def UnnamedTypeTemplateArgs : DiagGroup<"unnamed-type-template-args",
                                         [CXX98CompatUnnamedTypeTemplateArgs]>;
@@ -1047,7 +1048,6 @@ def UnusedButSetVariable : 
DiagGroup<"unused-but-set-variable">;
 def UnusedLocalTypedef : DiagGroup<"unused-local-typedef">;
 def UnusedPropertyIvar :  DiagGroup<"unused-property-ivar">;
 def UnusedGetterReturnValue : DiagGroup<"unused-getter-return-value">;
-def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">;
 def UsedSearchPath : DiagGroup<"search-path-usage">;
 def UserDefinedLiterals : DiagGroup<"user-defined-literals">;
 def UserDefinedWarnings : DiagGroup<"user-defined-warnings">;

>From 72cb70bf7c99cafd6ed4e4888d0f86f61a9a5cb4 Mon Sep 17 00:00:00 2001
From: John Jepko <[email protected]>
Date: Wed, 4 Feb 2026 23:39:10 +0100
Subject: [PATCH 2/2] test -Wattributes enables -Wused-but-marked-unsed

---
 clang/test/Sema/attr-unused.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/clang/test/Sema/attr-unused.c b/clang/test/Sema/attr-unused.c
index 49b90b5f50eac..8d3519b39e1d9 100644
--- a/clang/test/Sema/attr-unused.c
+++ b/clang/test/Sema/attr-unused.c
@@ -1,4 +1,5 @@
 // RUN: %clang_cc1 -verify -Wunused -Wused-but-marked-unused 
-Wunused-parameter -Wunused -Wno-strict-prototypes -fsyntax-only %s
+// RUN: %clang_cc1 -verify -Wunused -Wattributes -Wunused-parameter -Wunused 
-Wno-strict-prototypes -fsyntax-only %s
 
 static void (*fp0)(void) __attribute__((unused));
 

_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to