https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70470
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 const double& z2 = std::min(std::abs(x), y); you IMHO bind the reference to a temporary that goes out of the scope at the end of the statement, so any uses of z2 beyond that trigger undefined behavior.