]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: checking ICE w/ constexpr if and lambda as def targ [PR117054]
authorPatrick Palka <ppalka@redhat.com>
Tue, 15 Oct 2024 17:13:15 +0000 (13:13 -0400)
committerPatrick Palka <ppalka@redhat.com>
Thu, 17 Oct 2024 14:39:58 +0000 (10:39 -0400)
commitc468a0051a5ff3f91498d955edb8f684d27afe0d
treee873c3f8108ebddd4e427202ce75accc66f55a04
parent36de56d3d643e7b8131fa6671b9e85258a1d1ca1
c++: checking ICE w/ constexpr if and lambda as def targ [PR117054]

Here we're tripping over the assert in extract_locals_r which enforces
that an extra-args tree appearing inside another extra-args tree doesn't
actually have extra args.  This invariant doesn't always hold for lambdas
(which recently gained the extra-args mechanism) but that should be
harmless since cp_walk_subtrees doesn't walk LAMBDA_EXPR_EXTRA_ARGS and
so should be immune to the PR114303 issue for now.  So let's just disable
this assert for lambdas.

PR c++/117054

gcc/cp/ChangeLog:

* pt.cc (extract_locals_r): Disable tree_extra_args assert
for LAMBDA_EXPR.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/lambda-targ9.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
(cherry picked from commit bb2bfdb2048aed18ef7dc01b51816a800e83ce54)
gcc/cp/pt.cc
gcc/testsuite/g++.dg/cpp2a/lambda-targ9.C [new file with mode: 0644]