[Bug c++/126752] [16/17 Regression] ICE in build_vec_init when initializing an array member of an aggregate

"jakub at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126752

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The fix will be simple:
--- gcc/cp/init.cc.jj   2026-08-07 22:59:40.789404047 +0200
+++ gcc/cp/init.cc      2026-08-12 00:16:22.913503966 +0200
@@ -5365,7 +5365,7 @@ build_vec_init (tree base, tree maxindex
              && !vec_safe_is_empty (*cleanup_flags))
            {
              auto l = (*cleanup_flags)->last ();
-             gcc_assert (TREE_PURPOSE (l) == iterator);
+             gcc_assert (TREE_PURPOSE (l) == rval);
              (*cleanup_flags)->pop ();
            }
          tree const_init = build_constructor (atype, const_vec);
plus testcase, but I wonder why this code no longer triggers on
initlist-array{23,24}.C.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.