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

    <tr>
        <th>Summary</th>
        <td>
            Clang's error on non-pack parameter of alias template in a dependent type
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang
      </td>
    </tr>

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

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

<pre>
    It seems that clang does not consider `sizeof...(xs)` to be a dependent expression when the call to foo is made with a known number of arguments. The expression must absolutely contain `xs...`.

The following code compiles with gcc, but not clang (https://godbolt.org/z/TYzvjTePT):

```cpp
template<int>
struct foo_impl {
  template<class>
  using f = int;
};

template<class... xs> constexpr int sizeof_pack = sizeof...(xs);

template<class... xs>
using foo = typename foo_impl< // error: pack expansion used as argument for non-pack parameter of alias template
  sizeof...(xs) // does not work
  // sizeof_pack<xs...>  // ok
>::template f<xs...>; // f is dependent on xs

template<class... xs>
using test = list<foo<xs>...>;

// template<class... xs>
// using test = foo<xs...>; // ok with pack...

test<int> a; // ko
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVEFv8jgQ_TXDZdTI2AHCIQdKi7S3PfSyp0-OMyEujieKnQ_aX79yQiltD_uthADZM-_NezNjHYI9eqISVo-welroMbY8lK_sdWy175kc-UXF9Vv5V8RA1AWMrY5onPZHrJkCeo5o2Adb04CwFsG-EzdZloEsLgHkFtYCI2NFqLGmnnxNPiJd-oFCsOzx3JLH2BIa7VwKbZjRBux0TXi2sUWNJ89nj37sKhqQG9TDcezIx5DhS0v3aN0YIuoqsBsjubdUW9TWp9IuIZW1FhmIJxC7-TulN-wcn60_ouGa0HDXW0dhJj8aA3KP1RhnrZN0kEUbYx9A7UAeQB6OXFfsYsbDEeThHeTh5Z_3368v9PdL8kDt7jlhLeaP6fv5JFLXOx0J1N76COp5Pg5xGE1MhvyyXe8QNo_zBeJdhnE6hFsO4hiSlAZBPeGEdk2CzdPn_--0E0iWZXhJUFNLY7I1IeDc1F-9NqcJ9WeT_xB3vr4WyDyBxbeevO7oJhPUHmdXkYaBB1A7nKjp0ms_dXkMVKMOtznAhgf07B-muF4PuqN4HRVndfi06-rRDwUfjLehPvNw-oi-3t3ZAGo_j5N6vl3zNT7pVDtQNxuwuQsH9fiR0KQx_9wJ9smk_2tjpBAnH50NEdS-YZ7YQD3fCL8M38z9H9jXqG8UH9g_lPBpXpZkTbr8ImIqax5r1HdJJ_62Dou6VPVWbfWCyuVGbDcrsZGbRVsWa7El3axEkRfLpVlVxZKaqsiV1ILMWixsKYXMhRLrZZGv5CYzYqlyU1WUV1StlhJyQZ22LnPud5e2dGFDGKkscinFwumKXJieQSmnDQcp04s4lCn-oRqPAXKRHA6fCNFGR-V-Dt-EeVhTF_9kENH6Lw9i2oLFOLjy27tiYztWmeEO5CExX38e-oFfyUSQh0lIAHmYtPwbAAD__yO3zpg">