[PATCH] D152443: Add SpaceAfterOperatorKeyword & SpaceAfterOperatorKeywordInCall style options for clang-format

Björn Schäpers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 11 12:47:01 PDT 2023


HazardyKnusperkeks added a comment.

In D152443#4412069 <https://reviews.llvm.org/D152443#4412069>, @KitsuneAlex wrote:

> This revision of the diff changes the names of the new style options to **SpaceAfterOperatorOverload** and **SpaceAfterOperatorCall**, which clarifies their scope a lot better i think.
> I also rewrote the logic to apply formatting that fits exactly what their name implies respectively,
> the new tests i added should cover all common use cases (except i forgot some again).

Two cases missing: `operator==()` (Calling within a class), and what happens when taking the address `&operator==`? (With and without qualification.)



================
Comment at: clang/unittests/Format/FormatTest.cpp:22916
+  verifyFormat("foo.operator==();", Style);
+  verifyFormat("foo.Foo::operator==();", Style);
+  verifyFormat("foo->operator==();", Style);
----------------
Nice to check for that too!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152443



More information about the cfe-commits mailing list