<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58734>58734</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [clang-format] SeparateDefinitionBlocks always puts a break between a "statement" macro and the consecutive function declaration.
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          WeZZard
      </td>
    </tr>
</table>

<pre>
    There is an odd behavior in combination of `SeperateDefinitionBlocks` and `StatementMacros`:

.clang-format:

```yaml
SeparateDefinitionBlocks: Always
StatementMacros:
  - INLINE_ALWAYS
```

Before formatting:

```C++
#define INLINE_ALWAYS inline __attribute__((always_inline))

INLINE_ALWAYS
void bar() {}
```

After formatting:

```C++
#define INLINE_ALWAYS inline __attribute__((always_inline))

INLINE_ALWAYS

void bar() {}
```

I've tried to move `INLINE_ALWAYS` from `StatementMacros` to `AttributeMacros` and `StatementAttributeLikeMacros`, all these combinations produce the same result which clang-format puts a break between the `INLINE_ALWAYS` and `bar`.

If we remove `INLINE_ALWAYS` from `StatementMacros`, the break disappear. But the break appears again if we attribute the `bar` function with two macros:

.clang-format:

```yaml
SeparateDefinitionBlocks: Always
```

Before formatting:

```C++
#define INLINE_ALWAYS inline __attribute__((always_inline))
#define NO_RETURN [[noreturn]]

NO_RETURN
INLINE_ALWAYS
void bar() {}
```

After formatting:

```C++
#define INLINE_ALWAYS inline __attribute__((always_inline))
#define NO_RETURN     [[noreturn]]

NO_RETURN
INLINE_ALWAYS

void bar() {
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzdVE1v2zAM_TX2hajhjzgfBx-SpgUKdBnQdijaSyDbdKxVtgJJTtB_P0pu0iRLd-gwoFhAxLZI6T1SfMxl-Zo91KgQuAbWgixLyLFmGy4V8BYK2eS8ZYZL8lXgDcN7XKNiBudY8ZZbx0zI4kWTiw4oXYghf4Ot-cYKJa3HS6ZeOPfCt_-gEKxdXVRSNcyc-Gy0s1fWiH6JINlZyGQKU7Flr_ot7gR3dzDABdwsbm8WV8vp7eP06f4E6RB-hsQKoadmeLv6iN6lF8-s9atxUlpyeIxDFRR2cbmksxTPO4PLpRePyZjjvewDvHhi7QDmDN2N5HQ3TLn9E_BGM280_0Mm08qg-oqJfC6dGy8ebRAIHUswEhpJXxRzDEBNWCnZnO9Cu40e010K747Txt2H3PKX9zAvvgQmBJgaNR5KQ8NaybIr0LpAswZBoe6EgW3NixoO2x3WnSGpQa6QvZDWzBaxdfvOJfNGzNZpGAZH9ahga2E-UQebhwXsKZRcs_UamQpg1pkDR79KXFeMJgF3ePvr3zHumUHVtYUbEltuajBbup9jDf5T4X9RJe-PWnxf3l09_LhbgJfOyFoiZjrVeunc2gGpfeT_MwbOVMH-_r4SH9aj9_5WFR-zaDgcJdEoDCO_zJJykkyYb7gRmBGXo95M5_BR90Gf63khM_DiWO8kR--9EJyQrWQKmhZYdIaTaveiKZGwlRslgd8pkdXGrJ124muyFWmqywMaOPQhxGb3uKCp8xMLQrnmWneo6SUdj5KBX2d5NcE0r1g1zkfjOAzLPB9ErErHw7Soqjz1BctRaJs3kWxxC-4IeqfUfZ7FYRxHURhFaTIcREFYjKNyGIeYJnmUhOgNQmwYF4HlEUi18lXmKOXdSpNTcG30u5NpzVctujLb81lnaqmyR3x-Zqr0HXTmqP8CO8KSsw">