mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 19:30:12 +01:00
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:
@@ -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]
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user