https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64562
Ville Voutilainen <ville.voutilainen at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid Status|UNCONFIRMED |NEW Last reconfirmed| |2015-01-12 CC| |ville.voutilainen at gmail dot com Ever confirmed|0 |1 Known to fail| |4.8.2, 4.9.1, 5.0 --- Comment #1 from Ville Voutilainen <ville.voutilainen at gmail dot com> --- Reducing the test slightly, removing iostreams: #define RETURN_TYPE auto namespace { struct S { RETURN_TYPE operator--() && { return 1; } RETURN_TYPE operator--() const && { return 2; } RETURN_TYPE operator--() & { return 3; } RETURN_TYPE operator--() const & { return 4; } }; const S callme() { return {}; } auto f1() { return --S(); } auto f2() { return --callme(); } auto f3() { S s; return --s; } auto f4() { const S s {}; return --s; } } int main() { f1(); f2(); f3(); f4(); }