[PATCH] D12501: [clang-format] Obj-C dictionary literals: Fixed typecast getting put on a separate line from the key
Kent Sutherland via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 17 11:20:31 PDT 2015
ksuther added inline comments.
================
Comment at: lib/Format/TokenAnnotator.cpp:377
@@ -376,1 +376,3 @@
+ (!Contexts.back().ColonIsDictLiteral ||
+ Style.Language != FormatStyle::LK_Cpp)) ||
Style.Language == FormatStyle::LK_Proto) &&
----------------
djasper wrote:
> Why the language check? If it is needed, can you add a test?
The language check is so that this only applies to Objective-C literals. Protocol Buffers already have a test suite that tests the conditional here (FormatTestProto.cpp). The reason for the check is that the tree for Objective-C literals and Protocol Buffers looks the same in this situation, but the format behavior needs to differ.
http://reviews.llvm.org/D12501
More information about the cfe-commits
mailing list