summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2013-08-12 03:51:17 +0000
committerManuel Klimek <klimek@google.com>2013-08-12 03:51:17 +0000
commitd57355031c0f19936c0a75d0061fc4ee9bc87a6a (patch)
tree662473aaf896253200b37a92d10338497bc45285 /clang/lib
parent2db270c895e38cd8219150c0a16a8585d99b3cda (diff)
downloadbcm5719-llvm-d57355031c0f19936c0a75d0061fc4ee9bc87a6a.tar.gz
bcm5719-llvm-d57355031c0f19936c0a75d0061fc4ee9bc87a6a.zip
This change fixes the formatting of statements such as catch (E& e).
Previously these were formatting as catch (E & e) because the inner parenthesis was being marked as an expression. Patch by Thomas Gibson-Robinson. llvm-svn: 188153
Diffstat (limited to 'clang/lib')
-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 4af23b01c2f..1a9012fa88d 100644
--- a/clang/lib/Format/TokenAnnotator.cpp
+++ b/clang/lib/Format/TokenAnnotator.cpp
@@ -592,7 +592,8 @@ private:
} else if (Current.isOneOf(tok::kw_return, tok::kw_throw) ||
(Current.is(tok::l_paren) && !Line.MustBeDeclaration &&
!Line.InPPDirective &&
- (!Current.Previous || Current.Previous->isNot(tok::kw_for)))) {
+ (!Current.Previous ||
+ !Current.Previous->isOneOf(tok::kw_for, tok::kw_catch)))) {
Contexts.back().IsExpression = true;
} else if (Current.isOneOf(tok::r_paren, tok::greater, tok::comma)) {
for (FormatToken *Previous = Current.Previous;
OpenPOWER on IntegriCloud