<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/138720>138720</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Misformatting around static_cast parentheses
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
DarkTyger
</td>
</tr>
</table>
<pre>
A couple items of note.
First, with clang-format 20, using `SpacesInCStyleCastParentheses: true` produces:
``` c++
static_cast<type>( value );
( size_t )value;
```
Where `SpacesInCStyleCastParentheses: false` produces:
``` c++
static_cast<type>(value);
( size_t )value;
```
Is that backwards?
Second, would we be able to get an option to achieve the following:
``` c++
static_cast<type>( value );
(size_t)value;
```
Something like the following would make sense:
`SpacesInCStyleCastParentheses: false` and `SpacesInStaticCastParentheses: true`.
Here's the relevant config:
```
SpacesInCStyleCastParentheses: true
SpacesInConditionalStatement: true
SpacesInContainerLiterals: false
SpacesInParentheses: true
SpacesInParens: Custom
SpacesInParensOptions:
ExceptDoubleParentheses: false
InConditionalStatements: true
InCStyleCasts: true
InEmptyParentheses: false
Other: true
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJykVF2L6zYQ_TXyy7BBluN8PPghN7uhF1puIYU-XsbyxFYjS0YaJ01_fbEduma_2KUgMMwZzZwzcyyM0dSOqBD5N5E_Jthz40PxiOH8x62mkJS-uhU70L7vLIFhaiP4EzjPtBByJ-TuYEJkofZwNdyAtujqh5MPLTIoOcT7aFwNYiWPHWqK393-yDdLe4z8OwZy3FCkKLIdcOhJrCR0wVe9HmNTD7GS0wEt1LfhyB1AZGSjf2qMLLI93zoS2ZNQG7ig7QmE2opsyhyC0fxDP3mIjvAE_Vd46vNnQ4E-RfWENn6B63tUJypfJ_o9AjfIUKI-XzFUUWSHCTmS9q4a9-F7W8GVoCTA0hKwh5oY0IHv2Hg3BFA3hi4E3BCcvLX-alw9aYH_P3ihNpOaD8UcfUvcDCax5vyCyl1Fi2eCSC7SfM6f3xK6ar7W4yjgfQferf0LBRJqHUdKgSxd0DFo706mfr3vQcmnHD7L864ywyrQDpSoJcdvpzEaR-FXwxTQzrQ9J33caURHYN9H9u0r6MdoibuNAZ7-1tTxo-9LS28OVe7gbf7z7gDzWbxEntqOb-8Vhx_cUJjdmM85qYqs2mZbTKhI18tVnqd5nidNUZWp3FC5JKmXy7WWpEusUK62KsMMT5iYQkmVy1yu0nWqsnyhSqnKNF1uNvlKZvoklpJaNHZh7aVd-FAnJsaeijTbrJVMLJZk4_hcKuXoCiMqlBpez1AMlx7Kvo5iKa2JHJ_LsGFLxW8mTo8jD-bG4HtXzf8n6J7nkfTBFg1zN25FHYQ61Iabvlxo3wp1GErfPw9d8H-RZqEOI6Eo1OHO-FKofwMAAP__2b3hdA">