]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
RISC-V: Remove use of structured binding to fix compiler warning
authorChristoph Müllner <christoph.muellner@vrull.eu>
Mon, 28 Jul 2025 15:31:06 +0000 (17:31 +0200)
committerChristoph Müllner <christoph.muellner@vrull.eu>
Tue, 29 Jul 2025 13:53:16 +0000 (15:53 +0200)
Function riscv_ext_is_subset () uses structured bindings to iterate over
all keys and values of an unordered map.  However, this is only
available since C++17 and causes a warning like this:
  warning: structured bindings only available with ‘-std=c++17’
This patch addresses the warning.

gcc/ChangeLog:

* common/config/riscv/riscv-common.cc (riscv_ext_is_subset):
Remove use of structured binding to fix compiler warning.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
gcc/common/config/riscv/riscv-common.cc

index 82037a3345284a3bb50b9deac72282ae1d92bf77..da3cb9f788dc887cbc2968201a095c8e72c4396d 100644 (file)
@@ -1606,8 +1606,9 @@ bool
 riscv_ext_is_subset (struct cl_target_option *opts,
                     struct cl_target_option *subset)
 {
-  for (const auto &[ext_name, ext_info] : riscv_ext_infos)
+  for (const auto &riscv_ext_info : riscv_ext_infos)
     {
+      const auto &ext_info = riscv_ext_info.second;
       if (ext_info.check_opts (opts) && !ext_info.check_opts (subset))
        return false;
     }