[Bug c++/77591] [6/7 Regression] decltype(auto) and ternary operator allow returning local reference without a warning

glisse at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Sep 14 15:44:00 GMT 2016


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

--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> ---
Before delayed folding, the conditional was probably eliminated before we even
reached the warning code in the front-end. The warning is duplicated in the
middle-end precisely because in some cases we need optimizations to notice what
is going on. Sure, the front-end could be made a little bit more clever, but I
am not convinced it is worth going too far in that direction.


More information about the Gcc-bugs mailing list