[PATCH] D116283: [clang-format] Add an option to add a space between operator overloading and opening parentheses

Rajat Bajpai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 29 07:54:05 PST 2021


rajatbajpai added a comment.

In D116283#3211590 <https://reviews.llvm.org/D116283#3211590>, @HazardyKnusperkeks wrote:

> Does it affect calling code? `a.operator++(5);` Should it? But please add tests for that.

Yes, it does affect the calling code as well. However, I am not sure if we should separate the two. Sure, I'll add a test case for it.



================
Comment at: clang/docs/ClangFormatStyleOptions.rst:3755
 
+  * ``bool AfterOperatorOverloading`` If ``true``, put a space between operator overloading and opening parentheses.
+
----------------
MyDeveloperDay wrote:
> curdeius wrote:
> > I'm not fond of the current name, exactly the "Overloading" part (but have no better suggestion right now). It seems a bit misleading to me.
> > 
> > Maybe AfterOverloadedOperator(Name)??? At least it would match the token kind name.
> +1 here,  AfterOperator?
@MyDeveloperDay Initially, I thought about using //AfterOperator// but it also seems a bit misleading. However, @curdeius suggestion seems reasonable given it matches with the token kind.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D116283/new/

https://reviews.llvm.org/D116283



More information about the llvm-commits mailing list