[PATCH] D114725: [clang-format] add back tests which didn't cause a regression

C. Rayroud via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 30 11:11:30 PST 2021

crayroud added inline comments.

Comment at: clang/unittests/Format/FormatTest.cpp:14277
+  // FIXME these tests regressed behaviour.
   // verifyFormat("T A::operator() () {}", SpaceFuncDef);
   verifyFormat("auto lambda = [] () { return 0; };", SpaceFuncDef);
MyDeveloperDay wrote:
> crayroud wrote:
> > crayroud wrote:
> > > What do you think of enabling this test and to remove the space before the opening parenthesis ? As it is now the expected behaviour to have no space.
> > In https://reviews.llvm.org/D114696, you proposed to add an operator overloading option to SpaceBeforeParensOptions. This example: "T A::operator() () {}" should be configured from AfterFunctionDefinitionName or operator overloading ?
> in this circumstance can you explain why you want to treat differently? I can't tell what you intended here was it by design or as a consequence?
> ```
> verifyFormat("T A::operator()();", SpaceFuncDef);
> verifyFormat("T A::operator() () {}", SpaceFuncDef);
> ```
During the refactoring I treated operator overloading as a function definition. Is it correct or not ?



More information about the cfe-commits mailing list