diff --git a/clang/include/clang/Tooling/Transformer/Transformer.h b/clang/include/clang/Tooling/Transformer/Transformer.h --- a/clang/include/clang/Tooling/Transformer/Transformer.h +++ b/clang/include/clang/Tooling/Transformer/Transformer.h @@ -120,6 +120,11 @@ size_t SelectedCase, const ast_matchers::MatchFinder::MatchResult &Match, TransformerResult &Result) { + // Silence a false positive GCC -Wunused-but-set-parameter warning in constexpr + // cases, by marking SelectedCase as used. See + // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85827 for details. The issue is + // fixed in GCC 10. + (void)SelectedCase; if constexpr (!std::is_void_v) { auto Metadata = Rule.Metadata[SelectedCase]->eval(Match); if (!Metadata)