diff options
author | Ben Hamilton <benhamilton@google.com> | 2018-03-27 15:01:17 +0000 |
---|---|---|
committer | Ben Hamilton <benhamilton@google.com> | 2018-03-27 15:01:17 +0000 |
commit | d54e7aa9e252a9d895c1250a0512e5323632efb8 (patch) | |
tree | b6b87e54a56144514c635ecea1b526f9c043491d /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | a93c5f5cbb1314b896d1468378ef80eef099cd0e (diff) | |
download | bcm5719-llvm-d54e7aa9e252a9d895c1250a0512e5323632efb8.tar.gz bcm5719-llvm-d54e7aa9e252a9d895c1250a0512e5323632efb8.zip |
[clang-format] Do not insert space before closing brace in ObjC dict literal
Summary:
Previously, `clang-format` would sometimes insert a space
before the closing brace in an Objective-C dictionary literal.
Unlike array literals (which obey `Style.SpacesInContainerLiterals`
to add a space after `[` and before `]`), Objective-C dictionary
literals currently are not meant to insert a space after `{` and before
`}`, regardless of `Style.SpacesInContainerLiterals`.
However, some constructs like `@{foo : @(bar)}` caused `clang-format`
to insert a space between `)` and `}`.
This fixes the issue and adds tests. (I understand the behavior is
not consistent between array literals and dictionary literals, but
that's existing behavior that's a much larger change.)
Test Plan: New tests added. Ran tests with:
% make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests
Reviewers: djasper, jolesiak, Wizard
Reviewed By: djasper
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D44816
llvm-svn: 328627
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions