[Bug libstdc++/51013] complex::{imag,real}() should maintain lvalue-returning extension in C++11

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Nov 8 15:20:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51013

--- Comment #8 from Jason Merrill <jason at gcc dot gnu.org> 2011-11-08 15:18:51 UTC ---
I meant that with the current libstdc++ complex, this is valid:

constexpr float f = complex<float>(2.4).real();

but adding a non-constexpr overload would cause that one to be selected for the
call above, making the declaration invalid.

Once we have ref-qualifiers, it should be OK to add the non-const overload with
an lvalue ref-qualifier, though.



More information about the Gcc-bugs mailing list