https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106853

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
In C89 that would be valid scope-wise (but C89 doesn't have compound literals
on the other side), but in C99 and later compound statements like if introduce
a new block scope.  So, accessing *p1 is valid during evaluation of the if
condition or during evaluation of the substatements, but not after the compound
statement ends.  As the testcase does that, it invokes UB and anything can
happen.

Reply via email to