]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: pack indexing and if consteval
authorJason Merrill <jason@redhat.com>
Sat, 22 Mar 2025 14:52:14 +0000 (10:52 -0400)
committerJason Merrill <jason@redhat.com>
Mon, 24 Mar 2025 17:03:18 +0000 (13:03 -0400)
commit94d1dacf350c3c463aead7e4d5c172f138045eb1
tree3e6fd12d51a06f62fffe4330b8f08932507a3b79
parent57fdc97dac1453849a76bdce265428d441a03de0
c++: pack indexing and if consteval

The pack index is manifestly constant-evaluated, and the call to
maybe_constant_value needs to reflect that or we wrongly complain about
non-constant index if the evaluation uses if consteval.

gcc/cp/ChangeLog:

* semantics.cc (finish_type_pack_element): Pass mce_true to
maybe_constant_value.

gcc/testsuite/ChangeLog:

* g++.dg/cpp26/pack-indexing16.C: New test.
gcc/cp/semantics.cc
gcc/testsuite/g++.dg/cpp26/pack-indexing16.C [new file with mode: 0644]