<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/55179>55179</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format: SeparateDefinitionBlocks does not fully honor 'clang-format off'
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
jaredgrubb
</td>
</tr>
</table>
<pre>
I would expect clang-format should never touch code between the control markers. This is innocuous but is surprising. Here is a small reproduction:
Style file:
```
SeparateDefinitionBlocks: Always
```
Input file:
```
/* clang-format off */
#define Foo 1
/* clang-format on */
struct Something {};
```
Output:
```
/* clang-format off */
#define Foo 1
/* clang-format on */
struct Something {};
```
This was tested with clang-format 14.0.0. I haven't tried other versions.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9U0uPmzAQ_jXmMlrEM5ADh0RR1Jx62P4BgwfwrrGRH6H59x3IVttUbW6tsAbP-_P4c2vErbnAYoISgN9n7Dx0iuvhpTd24h7cuLk0XtGCN6EboTMCoUW_IGrwI5JBe2sUTNy-o3UxfBulg3VpbbpggoM2-NXggp2tdFIPMXxBi6uNg5u4UmBxtkaEzkujWX5gyYklH_LV3xRCLxV-OnbJx7pH4Mwt93jCXmq5ljgq0707ioeDWvjN_THtLi96JnjPyrPszLLD42RM3wMZV9cWQ0ou1vYIZ2MgfZKpHxLv0nlLZ4dXM6EfaUDAqiOrTiw_PkH-NXiC_g9Q_wfsG0kW7sCj8yhgkX587JUWcUIfXGDkV9Qsqzx4KynWEO0sECUd3bSLI9HkYp_veeSlV9j8WmVlwN_YAcKgA23o8oNSNxiNNpbOV_0-MjJFwapm9H5eObVN5jwQ4tDGnZlIUer68_dCRH6jl0SqdC6go01ZptU-GhveJ1VeJ1W1Q173IqnSYl_2nPe1SNu-6yLFW1SuYeWRZZnGBbYStGflKZJNlmRZUmR1luQFzWeHaV-maZ7uM6yLomZFghOXKl5xxMYOkW02SG0YHDmVdN59OrlzctCIWzuqz4MfjW3euEUx2NC20da92dD_AIM_RuM">