<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/118142>118142</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] RemoveParentheses RPS_MultipleParentheses removes parentheses for parameter pack expansion
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vaijns
</td>
</tr>
</table>
<pre>
When having `RemoveParentheses` on `RPS_MultipleParentheses` it removes parentheses around parameter pack expansions e.g. in a `static_assert()`:
```c++
template<bool... Values>
bool test(){
static_assert((Values && ...));
return true;
}
int main(){
test<true, true, true, true>();
}
```
replaces the static_assert with `static_assert(Values && ...);` which doesn't compile because you have to add the extra parentheses when expanding the parameter pack.
I know that it says setting `RemoveParentheses` to anything else than `Leave` can lead to incorrect code but still though I'd report it, maybe it's possible to detect the parameter pack expansion and leave the parentheses in this case.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx8VFFv3DYM_jXyCxHDpu_s84MfLkkPKLABxQZsj4UssWe1smSI9KX37wc512Vp0gEGLEjfR_IjP0kzu3MgGtT-Xu0fC73KFNNw0e5r4GKM9jr8PVGASV9cOINqqz9ojhf6pBMFmYiJVVtBDNvRpz8__756cYv_GeAE0kZkWF5OQKe4Bpu39ExCCRZtvgF9X3RgFwMDlecSXACd47NoceazZqYkCg8Ke9VWqjmq6pgX22cU3uevOgrNi9dCqnkYY_RlWcJf2q_EqvmgqmPeAyH-EanLHFX1b7McnmmgsFXYQlmWGY-9am6URLKmAJJWuu11j9vJ0QWBWbvwU44tbfOwEfAB3v03H26k_0b8ofI5eqLFa0MMMhG8qhuenEzv9exdKc19ntHT5MwENhIHhZ2AifPiPMFIRq9McI1r9gGBRNDWbknpuyT9aqRP2S7bBG12TAa9Hm_5XPtH-BbiE8ikJbuD9ZWBSeT_bJYTh6tMGUOeKbM35_1G-kIZYXQAT9pmqAsmpkQmK7EE4yrA4rwHmeJ6nuCjws5CoiWmXEJu_KyvI23rjmGJzG70m15LkgO9VfNiVtDB5ty5Qc-wf3viAsjkGIxmKgs7NLZvel3QUHcN9og7xGIaWrNvar3ramrqdmcOh7FvG7QH26PZo24LN2CFu7rGHhussCqrrq12LbXW1qavsVO7imbtfOn9ZS5jOheOeaWhrg_1DguvR_K8XXVE43U4332JadaiEPPlT0Pm3Y3rmdWu8o6FXyKJE789E6-I-0d4Myn4xTvw7gvwJaZfdrRYkx8mkYXzHceTwtPZybSOpYmzwlOu7fa7W1L8SkYUnjbJrPB0U30Z8J8AAAD__xDoml8">