diff options
author | Jakub Jelinek <jakub@redhat.com> | 2025-02-07 17:08:39 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2025-02-07 17:08:39 +0100 |
commit | ca7c6d1212b8589deed18386427c67851af2b9ad (patch) | |
tree | 46191832c830e7cb45e163147fd1fb0a7bc1a33e /gcc/fortran | |
parent | 35d40b56eb6e7ac63c790a799d3b367742d58a5e (diff) | |
download | gcc-ca7c6d1212b8589deed18386427c67851af2b9ad.zip gcc-ca7c6d1212b8589deed18386427c67851af2b9ad.tar.gz gcc-ca7c6d1212b8589deed18386427c67851af2b9ad.tar.bz2 |
c++: Fix up name independent decl in structured binding handling in range for [PR115586]
cp_parser_range_for temporarily reverts IDENTIFIER_BINDING changes
to hide the decls from the structured bindings from lookup during
parsing of the expression after :
If there are 2 or more name independent decls, we undo IDENTIFIER_BINDING
for the same name multiple times, even when just one has been added
(with a TREE_LIST inside of it as decl).
The following patch fixes it by handling the _ name at most once, the
later loop will DTRT then and just reinstall the temporarily hidden
binding with the TREE_LIST in there.
2025-02-07 Jakub Jelinek <jakub@redhat.com>
PR c++/115586
* parser.cc (cp_parser_range_for): For name independent decls in
structured bindings, only push the name/binding once per
structured binding.
* g++.dg/cpp26/name-independent-decl9.C: New test.
* g++.dg/cpp26/name-independent-decl10.C: New test.
Diffstat (limited to 'gcc/fortran')
0 files changed, 0 insertions, 0 deletions