]> granicus.if.org Git - clang/commit
clang-format: Format Objective-C try blocks like all the other try blocks.
authorNico Weber <nicolasweber@gmx.de>
Sat, 7 Feb 2015 01:57:32 +0000 (01:57 +0000)
committerNico Weber <nicolasweber@gmx.de>
Sat, 7 Feb 2015 01:57:32 +0000 (01:57 +0000)
commite2dff4cebe77a1fb65267e942388e78d2046de3d
tree89c9fdcb585a13311c7f9097cc059c2ad44cfe3b
parent472fd7de291de673eb762d20600feab4eb472e8a
clang-format: Format Objective-C try blocks like all the other try blocks.

Before:

  @try {
    // ...
  }
  @finally {
    // ...
  }

Now:

  @try {
    // ...
  } @finally {
    // ...
  }

This is consistent with how we format C++ try blocks and SEH try blocks.
clang-format not doing this before was an implementation oversight.

This is dependent on BraceBreakingStyle.  The snippet above is with the
Attach style.  Style Stroustrip for example still results in the "Before:"
snippet, which makes sense since other blocks (try, else) break after '}' too.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@228483 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/UnwrappedLineFormatter.cpp
lib/Format/UnwrappedLineParser.cpp
unittests/Format/FormatTest.cpp