]> gcc.gnu.org Git - gcc.git/commit
Fix PR c++/109958: ICE taking the address of bound static member function brought...
authorSimon Martin <simon@nasilyan.com>
Sun, 2 Jun 2024 15:45:04 +0000 (17:45 +0200)
committerSimon Martin <simon@nasilyan.com>
Sun, 2 Jun 2024 15:49:48 +0000 (17:49 +0200)
commit47827293551a3ec339617678c8e938c8ca3790f1
treea2e892ef07b9ea22c967313c495e1d6986ed01a4
parent80c1a963bdfb573feb398ef02269671a5d690c1f
Fix PR c++/109958: ICE taking the address of bound static member function brought into derived class by using-declaration

We currently ICE upon the following because we don't properly handle the
overload created for B::f through the using statement.

=== cut here ===
struct B { static int f(); };
struct D : B { using B::f; };
void f(D d) { &d.f; }
=== cut here ===

This patch makes build_class_member_access_expr and cp_build_addr_expr_1 handle
such overloads, and fixes the PR.

Successfully tested on x86_64-pc-linux-gnu.

PR c++/109958

gcc/cp/ChangeLog:

* typeck.cc (build_class_member_access_expr): Handle single OVERLOADs.
(cp_build_addr_expr_1): Likewise.

gcc/testsuite/ChangeLog:

* g++.dg/overload/using6.C: New test.
gcc/cp/typeck.cc
gcc/testsuite/g++.dg/overload/using6.C [new file with mode: 0644]
This page took 0.064164 seconds and 5 git commands to generate.