<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/54522>54522</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Clang-format 14] `WhitespaceSensitiveMacros` setting is broken
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
adalisk-emikhaylov
</td>
</tr>
</table>
<pre>
`WhitespaceSensitiveMacros` used to completely disable formatting for the specified macros. Starting from Clang-format 14 it no longer does that. It still does *something*, but I'm not sure what exactly.
Here's a code sample: (C++)
```cpp
#define FOO(x)
FOO(1+2)
```
`.clang-format`:
```yaml
WhitespaceSensitiveMacros:
- FOO
```
Code after formatting:
```cpp
#define FOO(x)
FOO(1 + 2)
```
As you can see, formatting introduced a whitespace change despite the setting.
In our codebase, we also used this setting to disable formatting for long multiline macros calls that are not whitespace-sensitive but are uglified by Clang-format. Now we'd need to wrap all of them in `// clang-format off`/`on`.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyVU01zmzAQ_TVw2TEDAjvxgYPjTKY5tDnk0LOEFlAjECOJOP73XQm7zkc9nTIaIa12V-_tPgkjj3WyyX_2yqObeIPPODrl1St-5401js5gdijBG2jMMGn0qI8gleNCI7TGDtx7NXZhCb5HcBM2qlUUMsQMGTx7bhcXawbYaz52qyUQigqUh9GANmOHFqRBR1m4z-DRg_NK68WWsJ0zA_qe8tA6YXsQs4fHhN0MFE--s0U4UCTgG2-8PmZJfp_ku2X-hhbJ1QEnFpJA8kAlKXeU-HafsLs4tqeQTb6MZppOFlZKbNWI8PD0RBFvF984L9aCkrCvWf5ss-Yd9XBQ7j65HvmgF9P1hpyDgL5VxPPX6-K8D1x566myl059vfZ_eVLR7uA60zjvHBzNDA0fwSGGfr3Tihq9NXJuSCScmnamCk1PBUKQtCXbIieMIR-6-TiCmW3spOAuJj8QT-3MSau9cufAINwrag2ag2HWpLJAeZErIdZ60SBwklTQ1gXhyp27EeUXHOZOL3IXxw_azuCHORAukp2EEZcndLB8IqAaTBvYDVQJCIVjDzTgvT7Ioz2dbHIzBvks5FNZl3JbbnnqlddYJ-u7T08qWd_Dv970uTpUKGHNC47pbHXdez9FhUU8nfL9LDJ69rTR-vX8W03W_MLG01Y5N6OjxbpaM5b2dSGacruRIq-wqIRYixvJiqKSZN9wXm1TzQVqF1AnjI14gJiC1oQ6VTXLGctLVuW31bYqMtaWZdXKorktqlzyMqlyHLjSWcCRGdulto6QxNw5OtTKeXc55M6pjmofr6P8fPa9sTWXnBxfVjiol54ftXlNI4o6svgNYauYOA">