diff options
author | Dongyan Chen <chendongyan@isrc.iscas.ac.cn> | 2025-05-19 15:17:12 +0800 |
---|---|---|
committer | Kito Cheng <kito.cheng@sifive.com> | 2025-05-19 16:34:58 +0800 |
commit | 7fabbf3562812f648bb49d0a7ea6b74e88defd4b (patch) | |
tree | ae60547059c24c2929ef22f3540aafd75b7c3362 /libstdc++-v3/testsuite | |
parent | 11936041970a45e5cf9a75110f365398451be6b5 (diff) | |
download | gcc-7fabbf3562812f648bb49d0a7ea6b74e88defd4b.zip gcc-7fabbf3562812f648bb49d0a7ea6b74e88defd4b.tar.gz gcc-7fabbf3562812f648bb49d0a7ea6b74e88defd4b.tar.bz2 |
RISC-V: Fix the warning of temporary object dangling references.
During the GCC compilation, some warnings about temporary object dangling
references emerged. They appeared in these code lines in riscv-common.cc:
const riscv_ext_info_t &implied_ext_info, const riscv_ext_info_t &ext_info = get_riscv_ext_info (ext) and auto &ext_info = get_riscv_ext_info (search_ext).
The issue arose because the local variable types were not used in a standardized
way, causing their references to dangle once the function ended.
To fix this, the patch changes the argument type of get_riscv_ext_info to
`const char *`, thereby eliminating the warnings.
Changes for v2:
- Change the argument type of get_riscv_ext_info to `const char *` to eliminate the warnings.
gcc/ChangeLog:
* common/config/riscv/riscv-common.cc (get_riscv_ext_info): Fix argument type.
(riscv_subset_list::check_implied_ext): Type conversion.
Diffstat (limited to 'libstdc++-v3/testsuite')
0 files changed, 0 insertions, 0 deletions