diff options
author | Jakub Jelinek <jakub@redhat.com> | 2025-08-11 09:02:38 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2025-08-11 09:05:45 +0200 |
commit | b7e4b5e862fcb12cfeaa3bee4e8c77098201d5f4 (patch) | |
tree | 919ac6c1c1c093ffcfd0df25c6ad1a8f7ddfced8 /libjava/java/net/URLStreamHandler.java | |
parent | 5274f490fa72830aafd278bc752145f1225b08e0 (diff) | |
download | gcc-b7e4b5e862fcb12cfeaa3bee4e8c77098201d5f4.zip gcc-b7e4b5e862fcb12cfeaa3bee4e8c77098201d5f4.tar.gz gcc-b7e4b5e862fcb12cfeaa3bee4e8c77098201d5f4.tar.bz2 |
c++: Fix up handling of name independent structured binding packs [PR117783]
I've realized I haven't added testsuite coverage for name independent
structured binding packs. And the
auto [i, ..._, j] = T {};
auto [k, ..._, l] = T {};
case shows a problem with that. The elements of the structured binding
pack have #i appended to their names, so for the _ case e.g. _#0, _#1
etc. (to print something useful in diagnostics, perhaps debug info later
on). The above is valid though as long as one doesn't use _ (which is
ambiguous), but we were emitting errors on redeclaration of _#0, _#1
etc.
The following patch uses DECL_NAME (decl) = NULL_TREE; for the
name independent decl case so that the false positive redeclaration
errors aren't emitted.
2025-08-11 Jakub Jelinek <jakub@redhat.com>
PR c++/117783
* decl.cc (set_sb_pack_name): For name independent decls
just clear DECL_NAME instead of appending #i to it.
* g++.dg/cpp26/name-independent-decl11.C: New test.
Diffstat (limited to 'libjava/java/net/URLStreamHandler.java')
0 files changed, 0 insertions, 0 deletions