This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Missing space between trailing return type 'auto' and left brace
ClosedPublic

Authored by denis-fatkulin on Jul 23 2022, 4:04 AM.

Details

Summary

There's no a space symbol between trailing return type auto and left brace {.

The simpliest examles of code to reproduce the issue:

[]() -> auto {}

and

auto foo() -> auto {}

Depends on D130299

Diff Detail

Event Timeline

denis-fatkulin created this revision.Jul 23 2022, 4:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2022, 4:04 AM
denis-fatkulin requested review of this revision.Jul 23 2022, 4:04 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 23 2022, 4:04 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
denis-fatkulin edited the summary of this revision. (Show Details)Jul 23 2022, 4:14 AM
This revision is now accepted and ready to land.Jul 23 2022, 12:48 PM
owenpan accepted this revision.Jul 23 2022, 8:54 PM
owenpan added a subscriber: owenpan.
owenpan added inline comments.
clang/unittests/Format/FormatTest.cpp
23555–23556

Should we add test cases with an & between auto and {?

curdeius accepted this revision.Jul 23 2022, 9:39 PM
curdeius added inline comments.
clang/unittests/Format/FormatTest.cpp
23555–23556

👍

Test cases for auto & and auto * are added

You should mark comments as done, if so.

denis-fatkulin marked 2 inline comments as done.Jul 24 2022, 2:39 PM

They marked done. Thanks!

clang/unittests/Format/FormatTest.cpp
23555–23556

Then it's better to add the case not only for auto &, but for auto * too.
But actually these cases are hadled correctly without this patch.

denis-fatkulin marked an inline comment as done.Jul 25 2022, 10:29 PM

Conflict with 'main' branch was solved