<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/102874>102874</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] Inconsistent formatting in case of SpacesInParensOptions.InCStyleCasts = false and Other = true
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dmitry-zakablukov
</td>
</tr>
</table>
<pre>
Consider this source:
```c++
void main() {
int a = ( int ) ( 1 + 2 );
int b = ( Namespace::Class ) ( 1 + 2 );
int c = ( Class ) ( 1 + 2 );
}
```
...and this `.clang-format`:
```
BasedOnStyle: LLVM
IndentWidth: 4
Language: Cpp
SpacesInParens: Custom
SpacesInParensOptions:
InCStyleCasts: false
Other: true
```
Running `clang-format` puts the spaces in C-style cast in case of namespace presense:
```c++
void main() {
int a = (int)( 1 + 2 );
int b = ( Namespace::Class )( 1 + 2 );
int c = (Class)( 1 + 2 );
}
```
Tested with `clang-format` 18 and 19, on Windows and macOS.
This issue may have the same bug nature as in #64416.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVE2PozgQ_TXmUgoCQxJy4NBJFClS72a1vdo-F1ABT4ONKJNW5tePbJKeSU-mew4jIaP6eLZf1Ssjs6o1US7mazHfBjjaxgx51Sk7nGdf8QWLdnwxp6Aw1TnfGM2qogFsoxjYjENJInkQ0VZED2IRTV8p5Np93nsyqoIOlRYyE3IFYnkJAAAobQFBJFsQMvOWT5EZxCDkGqSzRXJFuITiLf1v7Ih7nG6QPGxaZP4YfzmxfNvic4xYbt-xm8wwDFFXUx3EIgrLFnU9O5qhQ-uSfirKZK6RqTroJ3tu3bXh8fH_v6bIXlek7bOqbOMC6eR9RF2PWPvcTd9PzidHmvf6HxxIsw-NbE13L3rorTI-6VqDvd744zfI1oOP2DJdowfb0OC8dhjpLoVp_XfUWunacX9HHfrRMtiGwDeHQWnYzNgdCSWydXaJTGCOoK8thH4gJs1_Tk1KW9fHT6TwuZp-W0we8QHgV0qa1v-ILVXwqmxzr6ZxBk5u8UrIDRgNz0pX5pW9s8Py8BTebOZUqZhHgg7P0OCJpoZgR1CMNWi040CAvjlCJos0jRdhUOVJtUpWGFAeL2WSzpdJKoMmJ0rSrKioTOfHFRbLSEZ0TKuFXFKBZYyBymUk0yiLZRxFq0iGizLJUsqO1SqdxxITkUbUoWrDtj11oRnqwF8vjyOZLdOgxYJa9m-QlDfcpXSv0pA73KwYaxZp1Cq2_H0nq2zr368b4HwLe12694otaQuT2zrN_iDAu8MS3oyI76-fEV9tPyDe5yYkGIc2b6zt_YTJnZC7WtlmLMLSdELu3CUvv1k_mC9UWiF3njsLubvQP-XyWwAAAP__d--XHA">