https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92467
--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- https://gcc.gnu.org/onlinedocs/gcc-9.2.0/gcc/Conditionals.html#Conditionals If I understand the extension correctly, we have: ({ auto &tmp = get1(); (tmp ? tmp: get2()).release(); }) This means the tmp variable goes out of the scope after the ?: statement ends.