https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117985
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
I think this uncovered a latent bug, one probably fixable by:
--- a/gcc/cp/init.cc
+++ b/gcc/cp/init.cc
@@ -5109,6 +5109,8 @@ build_vec_init (tree base, tree maxindex, tree init,
{
if (!saw_non_const)
{
+ if (cleanup_flags)
+ vec_safe_truncate (*cleanup_flags, 0);
tree const_init = build_constructor (atype, const_vec);
return build2 (INIT_EXPR, atype, obase, const_init);
}
