[Bug c++/109247] [13 Regression] optional<T> o; o = {x}; wants to use explicit optional(U) constructor since r13-6765-ga226590fefb35ed6

jason at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Mar 23 13:20:41 GMT 2023


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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
No templates (so it's ambiguous, but the problem is the same):

struct B { int a; };
struct C {
  explicit C (int);
  C& operator= (B);
  C& operator= (const C&);
};
void f(C x)
{
  x = { 42 };
}


More information about the Gcc-bugs mailing list