<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/154964>154964</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Add sugar types for pack-indexed builtins
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ilya-biryukov
</td>
</tr>
</table>
<pre>
#106730 added the `__builtin_dedup_pack`, but it lacks some sugar after substitution, see the FIXME https://github.com/llvm/llvm-project/blob/db63c57c59e67c65f487b2d88cbc9ac89dfdd01b/clang/lib/Sema/SemaTemplateInstantiate.cpp#L1730
We need to be careful to make the resulting operations linear and avoid quadratic compile times as in #153431.
Otherwise sharing the common data and concepts with `PackIndexingType` should be beneficial for this, see https://github.com/llvm/llvm-project/blob/db63c57c59e67c65f487b2d88cbc9ac89dfdd01b/clang/include/clang/AST/Type.h#L6280
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy8k0-P2yoUxT8N3lxNhPHfLLzI-2NppPfUSjNSu4sucG3TYHANZJpvX5Fm1G676Qph0PG5v8PBEMzsiAbW_MWafwpMcfH7YOwNn6TZb-nir4X0-jYwUZW87SoOgFqThrgQsJafzzIZG407a9JpO2-oLqzlTPwNMkUwESyqS4DgV4KQZtwBp0g7hCRDNDFF412-HYjumuPz5___hSXGLbDqxMTIxDibuCR5UH5lYrT2-r48bbv_QioyMUrrJROjlm2lmk41R2o71TZT3XdS6L5XUh1R9Uc9ac3LfFVZdHMWMnn3Qis-lldaN4uRnl2I6KLBSAe1bUxU_5VdxRk_MX76ROAoY_AgCRTuNCWbdytefgyyU0gZzAx-ox3znAGscZQROA149UbD14Q6HypQft2MJYhmpQAYwDjI1JuqrsoD46cPcaH9zQSCsOCehfNvlF9X70BjxLus8k7RFgO8mbjkhD6iujw7Td-Mm19vG7GWQ1h8sjo7l-RoMsqghcnvEBcT3tP4gxkYp2zS9MuX08srE2P2e1gy-Vb0vNBDpY_VEQsayq5p-q7ua14sQ9Vi32JbYyv7uj5WfVeh6kpZIa_rTrWFGQQXDe-FKBvOa34gFBXWfcubCftOT6zmtKKxhzzSwe9zYUJINJRNfWzrwqIkG-4tEcLRG9xPmRC5NPtw5yDTHFjNrQkx_JSJJloaTlo_Hn-8bRTuqHNTnkwOhjQ8ShSKtNvht8Hf3QQmxofd6yC-BwAA__-faEL5">