diff options
author | Ben Hamilton <benhamilton@google.com> | 2018-02-08 16:07:25 +0000 |
---|---|---|
committer | Ben Hamilton <benhamilton@google.com> | 2018-02-08 16:07:25 +0000 |
commit | 09051f2925ae059ac724ebd2b6de01aa239f26c6 (patch) | |
tree | 759b2d94c9b9274cd0515411387f973c1081bad0 /lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py | |
parent | 976f317f0c89cab5d5e849b66993472486869ffd (diff) | |
download | bcm5719-llvm-09051f2925ae059ac724ebd2b6de01aa239f26c6.tar.gz bcm5719-llvm-09051f2925ae059ac724ebd2b6de01aa239f26c6.zip |
[clang-format] Do not break Objective-C string literals inside array literals
Summary:
Concatenating Objective-C string literals inside an array literal
raises the warning -Wobjc-string-concatenation (which is enabled by default).
clang-format currently splits and concatenates string literals like
the following:
NSArray *myArray = @[ @"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ];
into:
NSArray *myArray =
@[ @"aaaaaaaaaaaaaaaaaaaaaaaaaaaa"
@"aaaaaaaaa" ];
which raises the warning. This is https://bugs.llvm.org/show_bug.cgi?id=36153 .
The options I can think of to fix this are:
1) Have clang-format disable Wobjc-string-concatenation by emitting
pragmas around the formatted code
2) Have clang-format wrap the string literals in a macro (which
disables the warning)
3) Disable string splitting for Objective-C string literals inside
array literals
I think 1) has no precedent, and I couldn't find a good
identity() macro for 2). So, this diff implements 3).
Test Plan: make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests
Reviewers: jolesiak, stephanemoore, djasper
Reviewed By: jolesiak
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D42704
llvm-svn: 324618
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/python_api/symbol-context/TestSymbolContext.py')
0 files changed, 0 insertions, 0 deletions