Disable -Wunused-template in clangd-tidy (#7750)

This is firing on some of our _used_ templates in eval.cpp in clang-tidy
24

It was coming to `-Wall` for clang as well
(https://github.com/llvm/llvm-project/issues/202945) but was reverted
due to issues like false positives
(https://github.com/llvm/llvm-project/pull/218638). Some fixes were
applied to try enable in `-Wall` in clang 23
(https://github.com/llvm/llvm-project/pull/222336) but it still remains
disabled by default for clang.
This commit is contained in:
Dana Jansens
2026-09-10 19:28:25 +00:00
committed by GitHub
parent dbcae83784
commit 6f1ae86ce4
2 changed files with 3 additions and 6 deletions
+2 -1
View File
@@ -11,7 +11,8 @@ Diagnostics:
# compiler.
# `unused-includes`: has false positives, reporting includes unused when
# they are used. Probably the same root cause as unused-function.
Suppress: [unused-function, unused-includes]
# `unused-template`: has false positives, which we see in eval.cpp.
Suppress: [unused-function, unused-includes, unused-template]
---
+1 -5
View File
@@ -878,12 +878,8 @@ static auto ReplaceFieldWithConstantValue(EvalContext& eval_context,
// Function template that can be called with an argument of type `T`. Used below
// to detect which overloads of `GetConstantValue` exist.
//
// Marked as maybe unused at it seems the use in a requires isn't tracked by the
// latest version of Clang's `-Wunused-template`.
// https://github.com/llvm/llvm-project/issues/218429
template <typename T>
[[maybe_unused]] static auto Accept(T /*arg*/) -> void {}
static auto Accept(T /*arg*/) -> void {}
// Determines whether a `GetConstantValue` overload exists for a given ID type.
// Note that we do not check whether `GetConstantValue` is *callable* with a