[Bug c++/103455] [9/10/11 Regression] internal compiler error: in dependent_type_p since r9-713-gd9338471b91bbe6e1
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Apr 7 19:19:18 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103455
--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Patrick Palka
<ppalka@gcc.gnu.org>:
https://gcc.gnu.org/g:722b23d7a616a92b29826c5bc795c49b2f7775da
commit r11-9793-g722b23d7a616a92b29826c5bc795c49b2f7775da
Author: Patrick Palka <ppalka@redhat.com>
Date: Sat Mar 26 10:20:16 2022 -0400
c++: ICE when building builtin operator->* set [PR103455]
Here when constructing the builtin operator->* candidate set according
to the available conversion functions for the operand types, we end up
considering a candidate with C1=T (through B's dependent conversion
function) and C2=F, during which we crash from DERIVED_FROM_P because
dependent_type_p sees a TEMPLATE_TYPE_PARM outside of a template
context.
Sidestepping the question of whether we should be considering such a
dependent conversion function here in the first place, it seems futile
to test DERIVED_FROM_P for anything other than an actual class type, so
this patch fixes this ICE by simply guarding the DERIVED_FROM_P test
with CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
PR c++/103455
gcc/cp/ChangeLog:
* call.c (add_builtin_candidate) <case MEMBER_REF>: Test
CLASS_TYPE_P instead of MAYBE_CLASS_TYPE_P.
gcc/testsuite/ChangeLog:
* g++.dg/overload/builtin6.C: New test.
(cherry picked from commit 04f19580e8dbdbc7366d0f5fd068aa0cecafdc9d)
More information about the Gcc-bugs
mailing list