Page MenuHomePhabricator

[clang-format] Extend SpaceBeforeParens for requires
AcceptedPublic

Authored by HazardyKnusperkeks on Sun, Nov 7, 1:06 PM.

Details

Summary

We can now configure the space between requires and the following paren,separate for clauses and expressions.

Diff Detail

Event Timeline

HazardyKnusperkeks requested review of this revision.Sun, Nov 7, 1:06 PM
HazardyKnusperkeks created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptSun, Nov 7, 1:06 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
curdeius added inline comments.
clang/docs/ClangFormatStyleOptions.rst
3756

You meant "if there is one", right?

clang/unittests/Format/FormatTest.cpp
14306

I'd like to see some tests for mixed true/false, false/true values of these parameters. You only test false/false and true/true combinations so far.

22636

This test seems redundant. Does it test something else than the above added ones?

HazardyKnusperkeks marked 2 inline comments as done.

Addressed comments.

clang/docs/ClangFormatStyleOptions.rst
3756

Yeah

clang/unittests/Format/FormatTest.cpp
22636

No it doesn't, I just thought I would put the requires stuff into the requires test case. I for one work with the gtest filter on single test cases if I work on some issue.

Now the new diff.

MyDeveloperDay accepted this revision.Tue, Nov 9, 11:32 AM

LGTM (nit the clang-format check)

This revision is now accepted and ready to land.Tue, Nov 9, 11:32 AM
owenpan added inline comments.Tue, Nov 9, 5:03 PM
clang/lib/Format/TokenAnnotator.cpp
3145–3148

Nit: remove else.