<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/135550>135550</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Clang pretends to supports indexing a pack of template-names
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang,
clang:frontend,
crash-on-invalid,
c++26
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
cor3ntin
</td>
</tr>
</table>
<pre>
```cpp
template <
template <typename> typename... TT>
struct S {
using First = TT...[0];
};
template <typename T>
struct U;
using A = S<U>::First;
A a;
```
https://compiler-explorer.com/z/b663d38hs
This code is not valid C++26 as pack indexing is only supported for types and expressions.
Clang fails to reject it, which subsequently leads to a crash at codegen.
Note that I'm writing the paper to make this well-formed, and I wonder if we shouldn't preemptively accept that as an extension or do nothing until the next WG21 meeting.
At the same time, adding a diagnostic to reject it should be easy.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxUU8Gy6igQ_Rqy6TIVITG6yCJ6n1NvM5vnq1mT0BrmEmCgc9X5-ikSvY5VVIXAoc_p7tMyRn2xiA2r9qz6yOREgwtN74KwpG3WOXVv2KZYVu89K1rC0RtJCEwcWNECAPz_iO4erRyRiR_w3Od5DqcTEz9Y0UYKU0_wC1i9fzyforYXOOoQCZj4gNMpz3NW7QtWfTCRUKx-bt75nwTwHvz3Al7itnPMX0wcfieQaJloZ64F1IJ8hH6mudAMRD4mND8yfuzd6LXBsMKbNy5gyHs3Mn78l_Fjt9kIJbZDXB6yoj0NOkLvFIKOYB3BlzRawYHxPeN7vgEZwcv-E7RVeEsidQRnzR3i5L0LhArOLsz1iyCtArz5gDFqZ2POivZgpL3AWWoTgRwE_Bt7Ak2MH-A66H6AOHUR_5nQkrmDQalmoIQ-yDiApFneBW3-LfpPRwg0SIKfjNcjXIOmJI0GBC89hhRglJ8JpCNc0ZjV2YURVWJNIn_C1VmFAfQZrghxcJNRlvGawAfE0ZP-QnMH2ffoaeGSKT_AG6FN2YELoFyq2ZC4J0vazAos3gj--oOvYURMuh7CW5qvYzIB6RFnLUqlxxKUlhfrIun-rUoPZdAhoIz3Vwm-V6YaoXZiJzNs1nVZVlXNqzIbmp2q6l3Rnet-I7ttLWshu2qz43zT1dttxzPd8IJXRbkW62pdrst8W5ZKKMUrLvqNEFtWFjhKbXJjvsbchUumY5ywWYuqqorMyA5NnOeR8z61mXHO-OH7T7Tn4CyhVa-L1NOVsyttZ6O9Lp6GSyfVRxaaRLrqpktkZWF0pPiSQZoMNouzfMDEMHvmYcn4MqtczOvO34O_SkMYsymY5n1uLpqGqXsMS6J6fFY-uNQNxo9z-pHx46MCXw3_LwAA__-MAHUq">