Issue 107701
Summary clang-format doesn't remove line break after leading annotation (e.g., [[nodiscard]])
Labels clang-format
Assignees
Reporter bernardosulzbach
    With clang-format version 18.1.8, a C++ input of

```cpp
[[nodiscard]]
std::array<float, 2> GetTargetSize() const noexcept;
```

does not get formatted to

```cpp
[[nodiscard]] std::array<float, 2> GetTargetSize() const noexcept;
```

even if the `ColumnLimit` allows for it.

This struck me as odd, and it seems to prevent clang-format from ever removing that line break once it decided to insert it, no matter how much the following function signature changes.

Is this intentional? If so, is there a way to instruct clang-format to not preserve those line breaks?
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to