diff options
author | Jason Merrill <jason@redhat.com> | 2022-06-22 14:57:21 -0400 |
---|---|---|
committer | Jason Merrill <jason@redhat.com> | 2022-06-22 18:01:27 -0400 |
commit | 349a39f061407ce2339d2ba25da97005f2030c88 (patch) | |
tree | 140436bdc913530adc76b8dc761c6eed4502d9c1 /gcc/cp/name-lookup.cc | |
parent | 445d8deffb6c9bc1f4a5ed0a8e02d7f31d3caec7 (diff) | |
download | gcc-349a39f061407ce2339d2ba25da97005f2030c88.zip gcc-349a39f061407ce2339d2ba25da97005f2030c88.tar.gz gcc-349a39f061407ce2339d2ba25da97005f2030c88.tar.bz2 |
c++: class scope function lookup [PR105908]
In r12-1273 for PR91706, I removed the code in get_class_binding that
stripped BASELINK. This testcase demonstrates that we still need to strip
it in outer_binding before putting the overload set in IDENTIFIER_BINDING,
for compatibility with bindings added directly for declarations.
PR c++/105908
gcc/cp/ChangeLog:
* name-lookup.cc (outer_binding): Strip BASELINK.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/trailing16.C: New test.
Diffstat (limited to 'gcc/cp/name-lookup.cc')
-rw-r--r-- | gcc/cp/name-lookup.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/cp/name-lookup.cc b/gcc/cp/name-lookup.cc index 421bf2e..ce62276 100644 --- a/gcc/cp/name-lookup.cc +++ b/gcc/cp/name-lookup.cc @@ -7629,6 +7629,10 @@ outer_binding (tree name, /* Thread this new class-scope binding onto the IDENTIFIER_BINDING list so that future lookups find it quickly. */ + if (BASELINK_P (class_binding->value)) + /* Don't put a BASELINK in IDENTIFIER_BINDING. */ + class_binding->value + = BASELINK_FUNCTIONS (class_binding->value); class_binding->previous = outer; if (binding) binding->previous = class_binding; |