This is an archive of the discontinued LLVM Phabricator instance.

[clang-format] Add `SpacesInAngles: Leave` option to keep spacing inside angle brackets as is.
ClosedPublic

Authored by curdeius on Apr 27 2021, 1:11 AM.

Details

Summary

A need for such an option came up in a few libc++ reviews. That's because libc++ has both code in C++03 and newer standards.
Currently, it uses Standard: C++03 setting for clang-format, but this breaks e.g. u8"string" literals.
Also, angle brackets are the only place where C++03-specific formatting needs to be applied.

Diff Detail

Event Timeline

curdeius requested review of this revision.Apr 27 2021, 1:11 AM
curdeius created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2021, 1:11 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Looks good, and I'm always in favor of having a Leave Option. :)

This revision is now accepted and ready to land.Apr 28 2021, 11:20 AM

Whoops, We forgot to regenerate ClangFormatStyleOptions.rst here following the change to Format.h

Whoops, We forgot to regenerate ClangFormatStyleOptions.rst here following the change to Format.h

Thansks for noticing. Just fixed this and D100727 in rG8702c6da.