* [Bug c++/109958] ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration
2023-05-24 18:45 [Bug c++/109958] New: ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration ed at catmur dot uk
@ 2023-05-24 18:51 ` mpolacek at gcc dot gnu.org
2023-05-24 19:06 ` [Bug c++/109958] [10/11/12/13/14 Regression] " mpolacek at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-05-24 18:51 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109958
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever confirmed|0 |1
CC| |mpolacek at gcc dot gnu.org
Last reconfirmed| |2023-05-24
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed. r0-115460-g57910f3a9a81e9:
commit 57910f3a9a81e9ad122a814255197f6f24c6af08
Author: Jason Merrill <jason@redhat.com>
Date: Sat Mar 3 19:53:30 2012 -0500
class.c (add_method): Always build an OVERLOAD for using-decls.
* class.c (add_method): Always build an OVERLOAD for using-decls.
* search.c (lookup_member): Handle getting an OVERLOAD for a
single function.
From-SVN: r184873
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/109958] [10/11/12/13/14 Regression] ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration
2023-05-24 18:45 [Bug c++/109958] New: ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration ed at catmur dot uk
2023-05-24 18:51 ` [Bug c++/109958] " mpolacek at gcc dot gnu.org
@ 2023-05-24 19:06 ` mpolacek at gcc dot gnu.org
2023-05-25 7:57 ` rguenth at gcc dot gnu.org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2023-05-24 19:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109958
Marek Polacek <mpolacek at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |ice-on-valid-code
Priority|P3 |P2
Summary|ICE: in build_ptrmem_type, |[10/11/12/13/14 Regression]
|at cp/decl.cc:11066 taking |ICE: in build_ptrmem_type,
|the address of bound static |at cp/decl.cc:11066 taking
|member function brought |the address of bound static
|into derived class by |member function brought
|using-declaration |into derived class by
| |using-declaration
Target Milestone|--- |10.5
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/109958] [10/11/12/13/14 Regression] ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration
2023-05-24 18:45 [Bug c++/109958] New: ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration ed at catmur dot uk
2023-05-24 18:51 ` [Bug c++/109958] " mpolacek at gcc dot gnu.org
2023-05-24 19:06 ` [Bug c++/109958] [10/11/12/13/14 Regression] " mpolacek at gcc dot gnu.org
@ 2023-05-25 7:57 ` rguenth at gcc dot gnu.org
2023-05-25 10:46 ` ed at catmur dot uk
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-05-25 7:57 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109958
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
so is that invalid code?
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/109958] [10/11/12/13/14 Regression] ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration
2023-05-24 18:45 [Bug c++/109958] New: ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration ed at catmur dot uk
` (2 preceding siblings ...)
2023-05-25 7:57 ` rguenth at gcc dot gnu.org
@ 2023-05-25 10:46 ` ed at catmur dot uk
2023-07-07 10:45 ` [Bug c++/109958] [11/12/13/14 " rguenth at gcc dot gnu.org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: ed at catmur dot uk @ 2023-05-25 10:46 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109958
--- Comment #3 from Ed Catmur <ed at catmur dot uk> ---
B::f is a static member function so yes, it's valid. A class member access
expression naming a static member function is an lvalue designating that
function, and it shouldn't make any difference that the function was found via
a using declaration.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/109958] [11/12/13/14 Regression] ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration
2023-05-24 18:45 [Bug c++/109958] New: ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration ed at catmur dot uk
` (3 preceding siblings ...)
2023-05-25 10:46 ` ed at catmur dot uk
@ 2023-07-07 10:45 ` rguenth at gcc dot gnu.org
2024-05-21 14:59 ` [Bug c++/109958] [11/12/13/14/15 " simartin at gcc dot gnu.org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:45 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109958
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|10.5 |11.5
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/109958] [11/12/13/14/15 Regression] ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration
2023-05-24 18:45 [Bug c++/109958] New: ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration ed at catmur dot uk
` (4 preceding siblings ...)
2023-07-07 10:45 ` [Bug c++/109958] [11/12/13/14 " rguenth at gcc dot gnu.org
@ 2024-05-21 14:59 ` simartin at gcc dot gnu.org
2024-06-02 15:50 ` cvs-commit at gcc dot gnu.org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: simartin at gcc dot gnu.org @ 2024-05-21 14:59 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109958
Simon Martin <simartin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |simartin at gcc dot gnu.org
--- Comment #5 from Simon Martin <simartin at gcc dot gnu.org> ---
Working on it
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/109958] [11/12/13/14/15 Regression] ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration
2023-05-24 18:45 [Bug c++/109958] New: ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration ed at catmur dot uk
` (5 preceding siblings ...)
2024-05-21 14:59 ` [Bug c++/109958] [11/12/13/14/15 " simartin at gcc dot gnu.org
@ 2024-06-02 15:50 ` cvs-commit at gcc dot gnu.org
2024-06-02 15:54 ` simartin at gcc dot gnu.org
2024-06-10 15:00 ` simartin at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-06-02 15:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109958
--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Simon Martin <simartin@gcc.gnu.org>:
https://gcc.gnu.org/g:47827293551a3ec339617678c8e938c8ca3790f1
commit r15-972-g47827293551a3ec339617678c8e938c8ca3790f1
Author: Simon Martin <simon@nasilyan.com>
Date: Sun Jun 2 17:45:04 2024 +0200
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.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/109958] [11/12/13/14/15 Regression] ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration
2023-05-24 18:45 [Bug c++/109958] New: ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration ed at catmur dot uk
` (6 preceding siblings ...)
2024-06-02 15:50 ` cvs-commit at gcc dot gnu.org
@ 2024-06-02 15:54 ` simartin at gcc dot gnu.org
2024-06-10 15:00 ` simartin at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: simartin at gcc dot gnu.org @ 2024-06-02 15:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109958
Simon Martin <simartin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|11.5 |14.2
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #7 from Simon Martin <simartin at gcc dot gnu.org> ---
Fixed in master
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/109958] [11/12/13/14/15 Regression] ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration
2023-05-24 18:45 [Bug c++/109958] New: ICE: in build_ptrmem_type, at cp/decl.cc:11066 taking the address of bound static member function brought into derived class by using-declaration ed at catmur dot uk
` (7 preceding siblings ...)
2024-06-02 15:54 ` simartin at gcc dot gnu.org
@ 2024-06-10 15:00 ` simartin at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: simartin at gcc dot gnu.org @ 2024-06-10 15:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109958
Simon Martin <simartin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|14.2 |15.0
^ permalink raw reply [flat|nested] 10+ messages in thread