https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53637
--- Comment #8 from TC <rs2740 at gmail dot com> --- The standard specifies when copy elision is allowed (http://eel.is/c++draft/class.copy#31). "return param ? a : b;" is not one of them. "param ? a : b" is hardly "the name of a non-volatile automatic object..."