Date
2023-02-15.00:00:00
Message id
7131

Content

[Accepted as a DR at the February, 2023 meeting.]

Consider:

  template<typename T, std::size_t N>
  struct A {
    T array[N];
  };

  A a = { "meow" };

The current wording says in 12.2.2.9 [over.match.class.deduct] bullet 1.8:

  • if ei is of array type and xi is a braced-init-list or string-literal, Ti is an rvalue reference to the declared type of ei, and
  • ...

This will fail overload resolution, because a string literal (which is an lvalue) does not match a parameter of type T (&&)[N].