https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106843
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The temporary that stores the Designated initializer goes out of scope at the end of the statement that is inside the if statement.