summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/TokenAnnotator.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2015-01-14 10:48:41 +0000
committerDaniel Jasper <djasper@google.com>2015-01-14 10:48:41 +0000
commite189d46512a710833f088bdd787458aecff71d21 (patch)
tree338e88a3757a09dd5c79de2d0502f324d2f26bb2 /clang/lib/Format/TokenAnnotator.cpp
parent5a1391410d384fe221cb2abec95f0d63d77794de (diff)
downloadbcm5719-llvm-e189d46512a710833f088bdd787458aecff71d21.tar.gz
bcm5719-llvm-e189d46512a710833f088bdd787458aecff71d21.zip
clang-format: [Java] Support try blocks with resources.
Before: try (SomeResource rs = someFunction()) { Something(); } After: try (SomeResource rs = someFunction()) { Something(); } llvm-svn: 225973
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r--clang/lib/Format/TokenAnnotator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp
index d0d888fa4d4..4ba3f919697 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -1701,7 +1701,8 @@ bool TokenAnnotator::spaceRequiredBetween(const AnnotatedLine &Line,
(Style.SpaceBeforeParens != FormatStyle::SBPO_Never &&
(Left.isOneOf(tok::kw_if, tok::kw_for, tok::kw_while,
tok::kw_switch, tok::kw_case) ||
- (Left.isOneOf(tok::kw_catch, tok::kw_new, tok::kw_delete) &&
+ (Left.isOneOf(tok::kw_try, tok::kw_catch, tok::kw_new,
+ tok::kw_delete) &&
(!Left.Previous || Left.Previous->isNot(tok::period))) ||
Left.IsForEachMacro)) ||
(Style.SpaceBeforeParens == FormatStyle::SBPO_Always &&
OpenPOWER on IntegriCloud