[clang] [clang][Sema] fix -Wunused-private-field false-positive when use is templated (PR #237374)
Nick Desaulniers via cfe-commits
cfe-commits at lists.llvm.org
Mon Nov 2 14:54:08 PST 2026
================
@@ -354,3 +354,25 @@ class C {
T t2; // ok
};
}
+
+namespace warn_unused_template {
+struct [[gnu::warn_unused]] WarnUnusedType {};
+
+template <typename T>
----------------
nickdesaulniers wrote:
ah, good point. In fixing the false-positive, I _regressed_ the true positive case. Added exactly the case you described, and fixed that regression in fac498d92ad9a132d47dac6d75bd0204aef96e0b.
https://github.com/llvm/llvm-project/pull/237374
More information about the cfe-commits
mailing list