summaryrefslogtreecommitdiff
path: root/test/CodeGen/default-address-space.c
diff options
context:
space:
mode:
authorFrancois Ferrand <thetypz@gmail.com>2017-06-19 14:41:21 +0000
committerFrancois Ferrand <thetypz@gmail.com>2017-06-19 14:41:21 +0000
commit0e83c02b0cedfbf32cc06a77394bc66dc71c2399 (patch)
tree66c132e4169fd58ce6a8d2fcf4f4014ebaece0a5 /test/CodeGen/default-address-space.c
parent27337711cd7156c2c7f48abe33b4e1f6771a261e (diff)
downloadclang-0e83c02b0cedfbf32cc06a77394bc66dc71c2399.tar.gz
clang-format: Fix C99 designated initializers corner cases
Summary: This fixes the missing space before the designated initializer when `Cpp11BracedListStyle=false` : const struct A a = { .a = 1, .b = 2 }; ^ Also, wrapping between opening brace and designated array initializers used to have an excessive penalty (like breaking between an expression and the subscript operator), leading to unexpected wrapping: const struct Aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa = {[1] = aaaaaaaaaaaaaaaaaaaaaaaaaaa, [2] = bbbbbbbbbbbbbbbbbbbbbbbbbbb}; instead of: const struct Aaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaa = { [1] = aaaaaaaaaaaaaaaaaaaaaaaaaaa, [2] = bbbbbbbbbbbbbbbbbbbbbbbbbbb}; Finally, designated array initializers are not binpacked, just like designated member initializers. Reviewers: djasper Reviewed By: djasper Subscribers: cfe-commits, krasimir, klimek Differential Revision: https://reviews.llvm.org/D33491 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@305696 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/default-address-space.c')
0 files changed, 0 insertions, 0 deletions