[Bug c++/114632] ICE when converting static / explicit this lambda to function pointer
cvs-commit at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jul 24 18:07:19 GMT 2025
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114632
--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:
https://gcc.gnu.org/g:eb59e58dcc4cdf36b8b2d4e1654fe4fa062b5bef
commit r16-2490-geb59e58dcc4cdf36b8b2d4e1654fe4fa062b5bef
Author: Jason Merrill <jason@redhat.com>
Date: Thu Jul 24 14:07:11 2025 -0400
c++: lambda convop in C++23 [PR114632]
The lambda conversion was ICEing for two C++23 features, static op() and
explicit object parameters. The issue with the former seems like a more
general issue: tsubst_function_decl recursing to substitute the parameters
was affected by cp_unevaluated_operand from the decltype that refers to the
declaration. Various places already make a point of clearing
cp_unevaluated_operand ahead of PARM_DECL tsubsting; doing it here makes
the
PR101233 fix redundant.
For explicit object lambdas, we want to implement CWG2561 and
just not declare the conversion.
PR c++/114632
PR c++/101233
gcc/cp/ChangeLog:
* lambda.cc (maybe_add_lambda_conv_op): Not for xobj lambda.
* pt.cc (tsubst_function_decl): Add cp_evaluated.
(alias_ctad_tweaks): Revert PR101233 fix.
gcc/testsuite/ChangeLog:
* g++.dg/cpp23/explicit-obj-lambda18.C: New test.
* g++.dg/cpp23/static-operator-call7.C: New test.
More information about the Gcc-bugs
mailing list