]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: ICE with concept, local class, and lambda [PR115561]
authorJason Merrill <jason@redhat.com>
Fri, 26 Jul 2024 20:53:03 +0000 (16:53 -0400)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 28 Jul 2024 17:06:02 +0000 (19:06 +0200)
commitb300fd3985cc1435ecea30d18d00bfab8022d091
tree6c31e6191019ffac9ac30e645b51aa522945a841
parent557373c0cd6c0d6b4a1e46dc7a53d929b60b3c9b
c++: ICE with concept, local class, and lambda [PR115561]

Here when we want to synthesize methods for foo()::B maybe_push_to_top_level
calls push_function_context, which sets cfun to a dummy value; later
finish_call_expr tries to set something in
cp_function_chain (i.e. cfun->language), which isn't set.  Many places in
the compiler check cfun && cp_function_chain to avoid this problem; here we
also want to check !cp_unevaluated_operand, like set_flags_from_callee does.

PR c++/115561

gcc/cp/ChangeLog:

* semantics.cc (finish_call_expr): Check cp_unevaluated_operand.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-lambda21.C: New test.
gcc/cp/semantics.cc
gcc/testsuite/g++.dg/cpp2a/concepts-lambda21.C [new file with mode: 0644]