[Bug libstdc++/77288] Std::experimental::optional::operator= implementation is broken in gcc 6.1

ville.voutilainen at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Aug 18 14:39:00 GMT 2016


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

--- Comment #3 from Ville Voutilainen <ville.voutilainen at gmail dot com> ---
>Now behaviour is the same as in gcc 5.1 - operator=(_Up&& __u) is chosen in 2 situations:
>1. _Up is NOT optional
>2. _Up is optional AND _Up is same as _Tp modulo cv-qualifiers, references etc.

How do you expect converting assignments to work if that signature
sfinaes away if decay<_Up> is not _Tp? As in, code like

optional<string> os;
os = "meow";


More information about the Gcc-bugs mailing list