[PATCH] D45498: [clang-format] Don't insert space between ObjC class and lightweight generic
Daniel Jasper via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 12 05:30:17 PDT 2018
djasper accepted this revision.
djasper added a comment.
This revision is now accepted and ready to land.
Looks good.
================
Comment at: lib/Format/TokenAnnotator.cpp:2357
+ return false;
+ else
+ // Protocol list -> space if configured. @interface Foo : Bar <Baz>
----------------
Don't use else after return.
https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return
I'd have a slight preference for writing:
bool IsLightweightGeneric =
Right.MatchingParen && Right.MatchingParen->Next &&
Right.MatchingParen->Next->is(tok::colon);
return !IsLightweightGeneric && Style.ObjCSpaceBeforeProtocolList;
Then I think it might not even need a comment (or a shorter one).
Repository:
rC Clang
https://reviews.llvm.org/D45498
More information about the cfe-commits
mailing list