This is an archive of the discontinued LLVM Phabricator instance.

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

Authored by MyDeveloperDay on Nov 29 2021, 10:23 AM.


Diff Detail

Event Timeline

MyDeveloperDay requested review of this revision.Nov 29 2021, 10:23 AM
MyDeveloperDay created this revision.

bring back another 2 verifyFormats

crayroud added inline comments.Nov 29 2021, 11:04 AM

Remove the comment too.


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.


As the the condition is to add a space before non empty parentheses, the test is valid.

MyDeveloperDay marked 3 inline comments as done.

Address review comments

Remove unrelated file

crayroud added inline comments.Nov 30 2021, 9:34 AM

In, you proposed to add an operator overloading option to SpaceBeforeParensOptions. This example: "T A::operator() () {}" should be configured from AfterFunctionDefinitionName or operator overloading ?

MyDeveloperDay marked an inline comment as done.Nov 30 2021, 10:43 AM
MyDeveloperDay added inline comments.

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);
MyDeveloperDay marked an inline comment as done.Nov 30 2021, 10:45 AM

Its really this case that caused me issues, the behaviour for the foo {} cases was different from the ::operator cases. My feeling is that one is being detected as a function the other not.

verifyFormat("::operator delete(foo);");
verifyFormat("::operator new(n * sizeof(foo));");
verifyFormat("foo() { ::operator delete(foo); }");
verifyFormat("foo() { ::operator new(n * sizeof(foo)); }");
crayroud added inline comments.Nov 30 2021, 11:11 AM

During the refactoring I treated operator overloading as a function definition. Is it correct or not ?

nicolasvasilache resigned from this revision.Jul 19 2022, 8:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 19 2022, 8:35 AM
MyDeveloperDay abandoned this revision.Sep 27 2022, 4:46 AM