https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106853
--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> --- The important part of the standards: 6.5.2.5 Compound literals 5 The value of the compound literal is that of an unnamed object initialized by the initializer list. If the compound literal occurs outside the body of a function, the object has static storage duration; otherwise, it has automatic storage duration associated with the enclosing block. ----- 6.8.4 Selection statements 3 A selection statement is a block whose scope is a strict subset of the scope of its enclosing block. Each associated substatement is also a block whose scope is a strict subset of the scope of the selection statement.