[PATCH] D110833: [clang-format] Refactor SpaceBeforeParens to add options
Christian Rayroud via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Nov 2 01:15:03 PDT 2021
crayroud added inline comments.
================
Comment at: clang/lib/Format/TokenAnnotator.cpp:3469
return true;
- if (Right.is(TT_OverloadedOperatorLParen))
- return spaceRequiredBeforeParens(Right);
- if (Left.is(tok::comma))
+ if (Left.is(tok::comma) && !Right.is(TT_OverloadedOperatorLParen))
return true;
----------------
MyDeveloperDay wrote:
> I'm ever so slightly struggling to see where this case is covered. Could you give me the line number?
Left.is(tok::comma) is used to always add a space after a coma, but we want to be able to configure the space after the coma in the following example:
```
bool operator,();
```
Verified by:
```
25201: verifyFormat("bool operator,();");
```
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110833/new/
https://reviews.llvm.org/D110833
More information about the cfe-commits
mailing list