[gcc(refs/vendors/riscv/heads/gcc-15-with-riscv-opts)] RISC-V: Remove use of structured binding to fix compiler warning
Jeff Law
law@gcc.gnu.org
Sat Jan 17 07:08:56 GMT 2026
https://gcc.gnu.org/g:62294f935f95cbd8520ab6e12bb02fabcf2c5c01
commit 62294f935f95cbd8520ab6e12bb02fabcf2c5c01
Author: Christoph Müllner <christoph.muellner@vrull.eu>
Date: Mon Jul 28 17:31:06 2025 +0200
RISC-V: Remove use of structured binding to fix compiler warning
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>
(cherry picked from commit b267361f23c98ab9d9ca2b0fcf23b57117a84752)
Diff:
---
gcc/common/config/riscv/riscv-common.cc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gcc/common/config/riscv/riscv-common.cc b/gcc/common/config/riscv/riscv-common.cc
index 82037a334528..da3cb9f788dc 100644
--- a/gcc/common/config/riscv/riscv-common.cc
+++ b/gcc/common/config/riscv/riscv-common.cc
@@ -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;
}
More information about the Gcc-cvs
mailing list