Jonathan Wakely <redi at gcc dot> changed:

           What    |Removed                     |Added
           Keywords|                            |rejects-valid
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-03-13
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot> ---
(In reply to Jose Dapena Paz from comment #0)
> For a template class with explicit copy and move constructors,

Those aren't copy and move constructors.


struct X
  X(const char*) { }

template <typename T>
class Foo {
  template <typename... Args>
  explicit Foo(Args&&... args);

  explicit Foo(const T&);
  explicit Foo(T&&) { }

  Foo(const Foo&) = delete;
  Foo& operator=(const Foo&) = delete;

  ~Foo() = default;

int main() {
  Foo<X> v({"a"});
} In function 'int main()': error: call of overloaded 'Foo(<brace-enclosed initializer list>)'
is ambiguous
   Foo<X> v({"a"});
                 ^ note: candidate: 'Foo<T>::Foo(const Foo<T>&) [with T = X]'
   Foo(const Foo&) = delete;
   ^~~ note: candidate: 'Foo<T>::Foo(T&&) [with T = X]'
   explicit Foo(T&&) { }
            ^~~ note: candidate: 'Foo<T>::Foo(const T&) [with T = X]'
   explicit Foo(const T&);

Reply via email to