<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/123142>123142</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-format indents class member functions oddly if there are function-like macro invocations
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
alanzhao1
</td>
</tr>
</table>
<pre>
Given
```cpp
class PA_LOCKABLE Lock {
public:
void Acquire() PA_EXCLUSIVE_LOCK_FUNCTION() {}
void Release() PA_UNLOCK_FUNCTION() {}
};
```
where `PA_LOCKABLE`, `PA_EXCLUSIVE_LOCK_FUNCTION()`, and `PA_UNLOCK_FUNCTION()` are macros,
clang-format returns
```cpp
class PA_LOCKABLE Lock{
public : void Acquire() PA_EXCLUSIVE_LOCK_FUNCTION(){} void Release()
PA_UNLOCK_FUNCTION(){}
};
```
The main issues are:
* A space is added before and after the colon after `public`
* The space is removed between the class name and the curly bracket
* Very strange indentation and newlining of the two member functions
This regression occurred somewhere between 10664813fca8d5ccbfd90bae9e791b7062dabd7c and 29ed6000d21edd1a88b2daad242e1f356cafbaca
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVE1v3DYQ_TXUhbBBjnb1cdBB3mSLoIZTtHHQWzAiR7usKXJLUmu4v76gpCRukaZFAWIXIue9efNmSIzRnBxRx_Z3bP-mwDmdfejQovvjjF4Wg9cv3Q_mSo6JPq9KrEtdLkz0ymKM_Kf-0_37w4_93f1bfu_VE2f1HRP9ZR6sUazMOM6v3mjeq99nE4hBw6DNuLe_Hu4ff3n38e3C8On4-HD48O79wxaQeeo3X-E_kyWMr-CPD9-F5d_y7rXstYrnMwXirBKvlOdDOGyb35W1RaLTW_Q3VbBKcAzEJ1TBRwaHNbWy6E43ow8TJh4ozcHF_-rraivnq7Gclf3_cXV15xuGZu5_rObfLP1wzqUax02MM8Vc-tr5vKDnPY8XVMRN5Kg1aT7Q6AMtLuKYKPB0Jq689W77ZpXYJmjNAT3PSb7QBJr8dSFKz0RuxS--OZxW4mVrDvaFDwHVE6WN5yOFFx5TQHcibpwmlzCZnNlp7ujZGmfciftxYUjPnk80DRT4ODuVA-Pnohcdp0AxZrhXag6BNI9-onXIPquToqp2jSxHhY3eKzWMuhUDUkt1K4daVKBx0LVaJEBLuhJCaJCktcSmGUAjatgBybHcVwrHARUWuit1W7ZYUCfrsmqbspZQnDssG12Cks3YyFpQJQfdlKRL3e5EPeygMB0I2Asp91BCU8ItNu0eGi1ktZNqbBTbCZrQ2Ftrr9OtD6diaWwnoZQ7KCwOZOPybAC8nmkGkB-S0GXczTCfItsJa2KKX5mSSZa6v9yEtQlxa-Df3eZea_vCzdKPPDSBvhzeWPO03TJu3NWrpZOxmIPtzildYh5DODI4nkw6z8Ot8hODYxaz_d1cgv-NVGJwXIeXwXEr89rBnwEAAP__d5uTrg">