]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: Return the underlying decl rather than the USING_DECL from update_binding [PR116913]
authorNathaniel Shead <nathanieloshead@gmail.com>
Fri, 4 Oct 2024 00:46:57 +0000 (10:46 +1000)
committerNathaniel Shead <nathanieloshead@gmail.com>
Fri, 4 Oct 2024 10:30:03 +0000 (20:30 +1000)
commit6a1e109158940ce3a2d1ceed3e1b614ea6c9a2de
tree779047dda8867ef16202b793cfb83211b7129392
parent7fb6526652ddd722931407f749a176cfea779147
c++: Return the underlying decl rather than the USING_DECL from update_binding [PR116913]

Users of pushdecl assume that the returned decl will be a possibly
updated decl matching the one that was passed in.  My r15-3910 change
broke this since in some cases we would now return USING_DECLs; this
patch fixes the situation.

PR c++/116913

gcc/cp/ChangeLog:

* name-lookup.cc (update_binding): Return the strip_using'd old
decl rather than the binding.

gcc/testsuite/ChangeLog:

* g++.dg/lookup/using70.C: New test.

Signed-off-by: Nathaniel Shead <nathanieloshead@gmail.com>
gcc/cp/name-lookup.cc
gcc/testsuite/g++.dg/lookup/using70.C [new file with mode: 0644]