diff options
author | Marek Polacek <polacek@redhat.com> | 2024-12-19 17:26:27 -0500 |
---|---|---|
committer | Marek Polacek <polacek@redhat.com> | 2025-01-10 09:14:42 -0500 |
commit | d64447946b0c8964dfd9731c3792af0fe4158cda (patch) | |
tree | 6b404358df0fa989ad23e2bbc54ba079b2c41800 /gcc/tree-vectorizer.h | |
parent | 8a2d5bc28089b2660310b964ef75fb05eb387f88 (diff) | |
download | gcc-d64447946b0c8964dfd9731c3792af0fe4158cda.zip gcc-d64447946b0c8964dfd9731c3792af0fe4158cda.tar.gz gcc-d64447946b0c8964dfd9731c3792af0fe4158cda.tar.bz2 |
c++: ICE with pack indexing and partial inst [PR117937]
Here we ICE in expand_expr_real_1:
if (exp)
{
tree context = decl_function_context (exp);
gcc_assert (SCOPE_FILE_SCOPE_P (context)
|| context == current_function_decl
on something like this test:
void
f (auto... args)
{
[&]<size_t... i>(seq<i...>) {
g(args...[i]...);
}(seq<0>());
}
because while current_function_decl is:
f<int>(int)::<lambda(seq<i ...>)> [with long unsigned int ...i = {0}]
(correct), context is:
f<int>(int)::<lambda(seq<i ...>)>
which is only the partial instantiation.
I think that when tsubst_pack_index gets a partial instantiation, e.g.
{*args#0} as the pack, we should still tsubst it. The args#0's value-expr
can be __closure->__args#0 where the closure's context is the partially
instantiated operator(). So we should let retrieve_local_specialization
find the right args#0.
PR c++/117937
gcc/cp/ChangeLog:
* pt.cc (tsubst_pack_index): tsubst the pack even when it's not
PACK_EXPANSION_P.
gcc/testsuite/ChangeLog:
* g++.dg/cpp26/pack-indexing13.C: New test.
* g++.dg/cpp26/pack-indexing14.C: New test.
Diffstat (limited to 'gcc/tree-vectorizer.h')
0 files changed, 0 insertions, 0 deletions