This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGce4c7a987fa3: [clang] Silence a false positive GCC 
-Wunused-but-set-parameter warning with… (authored by mstorsjo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D132920/new/

https://reviews.llvm.org/D132920

Files:
  clang/include/clang/Tooling/Transformer/Transformer.h


Index: clang/include/clang/Tooling/Transformer/Transformer.h
===================================================================
--- clang/include/clang/Tooling/Transformer/Transformer.h
+++ clang/include/clang/Tooling/Transformer/Transformer.h
@@ -120,6 +120,11 @@
                  size_t SelectedCase,
                  const ast_matchers::MatchFinder::MatchResult &Match,
                  TransformerResult<T> &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<T>) {
     auto Metadata = Rule.Metadata[SelectedCase]->eval(Match);
     if (!Metadata)


Index: clang/include/clang/Tooling/Transformer/Transformer.h
===================================================================
--- clang/include/clang/Tooling/Transformer/Transformer.h
+++ clang/include/clang/Tooling/Transformer/Transformer.h
@@ -120,6 +120,11 @@
                  size_t SelectedCase,
                  const ast_matchers::MatchFinder::MatchResult &Match,
                  TransformerResult<T> &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<T>) {
     auto Metadata = Rule.Metadata[SelectedCase]->eval(Match);
     if (!Metadata)
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to