<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/56611>56611</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`AlignedAttr` ignores parameter pack
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
andreasfertig
</td>
</tr>
</table>
<pre>
Hello,
the following code contains an `alignas` which contains a parameter pack:
```cpp
template <typename... Ts>
struct AlignedStructWithPack
{
char data alignas(Ts...);
};
int main()
{
AlignedStructWithPack<int, char, double> a{};
}
```
The AST dump doesn't show the ellipsis [godbolt.org/z/hhaW85hYP](https://godbolt.org/z/hhaW85hYP):
```
...
| | `-FieldDecl <line:4:4, col:9> col:9 data 'char'
| | `-AlignedAttr <col:14> alignas
| | `-UnaryExprOrTypeTraitExpr <col:22, col:24> 'unsigned long' alignof 'Ts'
...
```
I had a hard time tracking this as some of the code gets generated. I'm unsure whether the issue is in `AlignedAttr` or `UnaryExprOrTypeTraitExpr`:
```cpp
Aligned attr{/*init*/};
attr.printPretty(/*...*/);
```
gives:
```
alignas(alignof(Ts))
```
Dumping only `UnaryExprOrTypeTraitExpr` results in:
```
UnaryExprOrTypeTraitExpr 0x7fb713871520 'unsigned long' alignof 'Ts'
```
It seems to me that the `UnaryExprOrTypeTraitExpr` does not treat the parameter pack.
Andreas
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVVE1v2zAM_TXOhahhy4mdHHxIkwbraQWaYdhRsZlYm2IZktw2-_Uj5bRJ27TFAH_IFvlIPj5qY-pD-Q21NpFYRMkySubD0zcIW0P_H1W7g8rUSI_WS9U6kC1EeSK12rXS0QoeG1U1Z_vQSSv36NHSqvoTZfNzaPIYrqrrjsFw32npEaJs4Q8dtuQcxzGsXZTdDCbO277yMOegWN-Hr5_KN3eMP8AW18MCAKpGWqill_CcpZiuHUFGYhZl188Oy5c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