public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104432] New: [12 Regression] ICE in operator() from filter_memfn_lookup since r12-6080
@ 2022-02-07 19:37 jakub at gcc dot gnu.org
2022-02-07 19:37 ` [Bug c++/104432] " jakub at gcc dot gnu.org
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-07 19:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104432
Bug ID: 104432
Summary: [12 Regression] ICE in operator() from
filter_memfn_lookup since r12-6080
Product: gcc
Version: 12.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
Target Milestone: ---
Since r12-6080-gab85331c58223e483c55ff0316a92265d7910e9b the following testcase
ICEs:
rh2051651.C: In instantiation of ‘void E< <template-parameter-1-1> >::bar()
[with <template-parameter-1-1> = int]’:
rh2051651.C:22:8: required from here
rh2051651.C:22:38: internal compiler error: in operator(), at cp/pt.c:16271
22 | void bar () { for (auto i : b) foo (i); }
| ~~~~^~~
0xddb7b4 operator()
../../gcc/cp/pt.c:16271
0xddbac4 filter_memfn_lookup
../../gcc/cp/pt.c:16276
0xddc1cf tsubst_baselink
../../gcc/cp/pt.c:16363
0xdf6444 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/cp/pt.c:20864
0xdf42e3 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
../../gcc/cp/pt.c:20494
0xdeed6a tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:19313
0xde6c18 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:18326
0xde8c90 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:18557
0xde9a37 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
../../gcc/cp/pt.c:18655
0xe0d76a instantiate_body
../../gcc/cp/pt.c:26236
0xe0f136 instantiate_decl(tree_node*, bool, bool)
../../gcc/cp/pt.c:26529
0xe0f4d2 instantiate_pending_templates(int)
../../gcc/cp/pt.c:26608
0xc10624 c_parse_final_cleanups()
../../gcc/cp/decl2.c:5097
0xf5edcd c_common_parse_file()
../../gcc/c-family/c-opts.c:1260
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
struct A {
int operator* ();
void operator++ ();
bool operator!= (A);
};
struct B {
A begin ();
A end ();
};
struct C {
template <typename>
void foo ();
};
struct D : public C {
void foo (int);
virtual void bar ();
};
template <typename = int> struct E : D {
using D::foo;
using C::foo;
B b;
void bar () { for (auto i : b) foo (i); }
};
struct F {
using G = E<>;
F() {}
G g;
};
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/104432] [12 Regression] ICE in operator() from filter_memfn_lookup since r12-6080
2022-02-07 19:37 [Bug c++/104432] New: [12 Regression] ICE in operator() from filter_memfn_lookup since r12-6080 jakub at gcc dot gnu.org
@ 2022-02-07 19:37 ` jakub at gcc dot gnu.org
2022-02-07 20:07 ` ppalka at gcc dot gnu.org
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-02-07 19:37 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104432
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
Target Milestone|--- |12.0
Status|UNCONFIRMED |NEW
CC| |ppalka at gcc dot gnu.org
Ever confirmed|0 |1
Last reconfirmed| |2022-02-07
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/104432] [12 Regression] ICE in operator() from filter_memfn_lookup since r12-6080
2022-02-07 19:37 [Bug c++/104432] New: [12 Regression] ICE in operator() from filter_memfn_lookup since r12-6080 jakub at gcc dot gnu.org
2022-02-07 19:37 ` [Bug c++/104432] " jakub at gcc dot gnu.org
@ 2022-02-07 20:07 ` ppalka at gcc dot gnu.org
2022-02-09 16:33 ` cvs-commit at gcc dot gnu.org
2022-02-09 16:34 ` ppalka at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-02-07 20:07 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104432
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |ppalka at gcc dot gnu.org
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/104432] [12 Regression] ICE in operator() from filter_memfn_lookup since r12-6080
2022-02-07 19:37 [Bug c++/104432] New: [12 Regression] ICE in operator() from filter_memfn_lookup since r12-6080 jakub at gcc dot gnu.org
2022-02-07 19:37 ` [Bug c++/104432] " jakub at gcc dot gnu.org
2022-02-07 20:07 ` ppalka at gcc dot gnu.org
@ 2022-02-09 16:33 ` cvs-commit at gcc dot gnu.org
2022-02-09 16:34 ` ppalka at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-09 16:33 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104432
--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:ee50b4383a0dca88172c3a821418344bd7391956
commit r12-7134-gee50b4383a0dca88172c3a821418344bd7391956
Author: Patrick Palka <ppalka@redhat.com>
Date: Wed Feb 9 11:33:04 2022 -0500
c++: memfn lookup consistency and using-decls [PR104432]
In filter_memfn_lookup, we weren't correctly recognizing and matching up
member functions introduced via a non-dependent using-decl. This caused
us to crash in the below testcases in which we correctly pruned the
overload set for the non-dependent call ahead of time, but then at
instantiation time filter_memfn_lookup failed to match the selected
function (introduced in each case by a non-dependent using-decl) to the
corresponding function from the new lookup set. Such member functions
need special handling in filter_memfn_lookup because they look exactly
the same in the old and new lookup sets, whereas ordinary member
functions that're defined in the (dependent) current class become more
specialized in the new lookup set.
This patch reworks the matching logic in filter_memfn_lookup so that it
handles (member functions introduced by) non-dependent using-decls
correctly, and is hopefully simpler overall.
PR c++/104432
gcc/cp/ChangeLog:
* call.cc (build_new_method_call): When a non-dependent call
resolves to a specialization of a member template, always build
the pruned overload set using the member template, not the
specialization.
* pt.cc (filter_memfn_lookup): New parameter newtype. Simplify
and correct how members from the new lookup set are matched to
those from the old one.
(tsubst_baselink): Pass binfo_type as newtype to
filter_memfn_lookup.
gcc/testsuite/ChangeLog:
* g++.dg/template/non-dependent19.C: New test.
* g++.dg/template/non-dependent19a.C: New test.
* g++.dg/template/non-dependent20.C: New test.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [Bug c++/104432] [12 Regression] ICE in operator() from filter_memfn_lookup since r12-6080
2022-02-07 19:37 [Bug c++/104432] New: [12 Regression] ICE in operator() from filter_memfn_lookup since r12-6080 jakub at gcc dot gnu.org
` (2 preceding siblings ...)
2022-02-09 16:33 ` cvs-commit at gcc dot gnu.org
@ 2022-02-09 16:34 ` ppalka at gcc dot gnu.org
3 siblings, 0 replies; 5+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-02-09 16:34 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104432
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-02-09 16:34 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 19:37 [Bug c++/104432] New: [12 Regression] ICE in operator() from filter_memfn_lookup since r12-6080 jakub at gcc dot gnu.org
2022-02-07 19:37 ` [Bug c++/104432] " jakub at gcc dot gnu.org
2022-02-07 20:07 ` ppalka at gcc dot gnu.org
2022-02-09 16:33 ` cvs-commit at gcc dot gnu.org
2022-02-09 16:34 ` ppalka at gcc dot gnu.org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).