<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/73666>73666</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            C++20: Deduction guides ignored for class type placeholder template argument
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          devreal
      </td>
    </tr>
</table>

<pre>
    I experimented with placeholders for deduced class types in templates using `std::array` (passing it as a template argument without explicitly specifying `std::array` during instantiation, instead relying on deduction guides). I found that GCC uses deduction guides to deduce the argument type while Clang seems to ignore them. 

Here is the smallest example I could come up with based on `std::array`:

```C
// trimmed-down std::array
template<class T, int I>
struct A {
    T x[I];
};

// deduction guide (like std::array)
template< class T, class... U >
A( T, U... ) -> A<T, 1 + sizeof...(U)>;

template<A a> void foo() { }

void bar() {
 foo<{1}>(); // works with GCC, fails with Clang
}
```

See also: https://godbolt.org/z/7vWa3zKoj

Apologies if this was reported before, I tried to search the open issues but couldn't find anything related to this. Also, I am not sure whether this is legal in C++20, I was just surprised to see it work in GCC but not in Clang. Please feel free to close this issue if this is not legal.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VV9vq7gT_TTOy6gITPPvgQdCm_uLfi8r7a322eAB3Gsw8pjmpp9-NSZts-muFCVgzzlzfGY8UUSmGxELsT6I9dNKzaF3vtD45lHZVe30pTgB_p7QmwHHgBrOJvQwWdVg76xGT9A6Dxr13KCGxioiCJcJCcwIAYfJqoAEM5mxA7FJKWiRlyIvlffqIjYpCLmbWMjYgQmgCNQnDpTvZk4c07o5sBZrGhPsBWjCxrSX_-TVs4-cIwU1BqOCcaOQVVxApcGjjWA3LvJ5H7rZaCQh9wmcoHXzqCH0KsCPqoKZkL6FQnDX00PobwSzB3DujUWorBo7IMQhRptudD5GDwmI9Emk5fL9P_QIhiIPDcpaJD6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