<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/98819>98819</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-format] cannot have different space-before-paren for named/conversion operator declarations and their explicit calls
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-format
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
urnathan
</td>
</tr>
</table>
<pre>
Named and conversion operator formatting only pays attention to `AfterOverloadedOperator`, which does not offer the same flexibility as regular function names wrt `AfterFunctionDeclarationName`, `AfterFunctionDefinitionName` and in call expressions. This is unfortunate.
```
/*
.clang-format contents:
BasedOnStyle: LLVM
SpaceBeforeParens: Custom
SpaceBeforeParensOptions:
AfterFunctionDeclarationName: true
AfterFunctionDefinitionName: true
AfterOverloadedOperator: true
*/
struct A {
// space before (, as expected
void frob(); // void frob ();
operator bool(); // operator bool ();
void operator+(int); // void operator+ (int);
};
void fn (A &a)
{
// no space before (, expected
a.frob (); // a.frob();
// space before (, undesired
a.operator+(1); // a.operator+ (1);
a.operator bool(); // a.operator bool ();
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMVM3O4jgQfBrn0gIFQ0hyyAEGcZrdb6VZ7b0Td4hXxkZ2hxnefuUk_IT5ZjUIhaCqdqer0oUh6JMlqkS2F9khwZ4756veW-QObVI7dav-xDMpQKugcfZKPmhnwV3IIzsPrfNnZNb2BM6aG1zwFgCZyXLksQOxTXctk_-4kjcOFamPqVhsUyG_wPdONx0oRwGsY3BtSx64Iwh4JmgN_dC1NppvgAE8nXqDHtreNkMHi2cK8N3zo9Fxgg7UGPQYb-MMU7efWa22-oU0jKotNGgM0I-LpxBHDkv4u9MBdIDets5zb5FpKdKDSHfTdZtO3_GvPAo5QcvGoD0tRrWikFGgINYTvMdA6sN-45shsd7B16___DEi3y7Y0J5a5-kv9GRjDXzpA7vzLwgflzjM82z4X1HWO2Df00R9586kmVN_5emMFeeXx1eNAvu-YdiByPf3poNQRwhxEqiHUUDIIrqFIVpADZO6s69OK2i9qwdKKdZ7iJ_pkAcKD_he-Hhna-fMs3gqnKE_Fw_n3jlC7oUstOV7_9fmLyR4ZU0q5Ifn_XAdn9hG7g6E3KKQJdzJ7xpZ96lM7xrhci7Bo34E3qb7DR96qyho_9phLsbqacWj1ZsSq7miT_xzQ97wd0uikPOtS1S1VuW6xISqVS7TMk8LmSVdtc0pw6woqSkxr7OW6iJPU4klbgqVN2miK5nKTZqvNqtM5mm2rDdZ0ajNpigLmdWpFJuUzqjN0pjreen8KdEh9FSVRbEqE4M1mTCEqJSviy6kjLHqq1i2qPtTEJvU6MDheRBrNkMAzwqzAzRoYxx2eCVQOoYiWR7NWYzmLC5x4WMEDymohDx-FtHqufJhCDfuSPv4zhjdaB6CLiS9N1XHfBmCY3DgpLnr62XjzkIe4_NOP4uLd_9Sw0IeBxWCkMdRiGsl_wsAAP__8Or0aw">