Issue 109371
Summary Incorrect clang-format PointerAlignment for brace-enclosed initialization within if-statement
Labels clang-format
Assignees
Reporter swalkner
    I can confirm this behaviour and would like to gently bump this report.

```cpp
if (MyClass * obj{GetMyClass()})
```
But - for some reason - `auto` and primitive-types seem to work as expected:
```cpp
if (auto* obj{GetMyClass()})
```
```cpp
if (int* obj{GetInt()})
```

I have reproduced that in clang-format:
* 17.0.3 (packaged with VS)
* 18.1.3 (and other versions via clang-format-configurator.site)

The only config option I changed:
> PointerAlignment: Left

(This issue has been split from #60146 )
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to