aboutsummaryrefslogtreecommitdiff
path: root/lib/Format/Format.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2013-01-07 16:36:17 +0000
committerNico Weber <nicolasweber@gmx.de>2013-01-07 16:36:17 +0000
commita9ccdd1b8ef31d1942193ffa6bc32781055cf493 (patch)
treefd44c3585b70f7659e1a85d595914b4166e04760 /lib/Format/Format.cpp
parentd0af4b46741560cf2e52d819e1f3a2506a1e7a3c (diff)
Formatter: Add tests for try/catch. Let 'throw' start an expression.
Before: throw a *b; Now: throw a * b; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171754 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r--lib/Format/Format.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp
index 8faa93cdc7..7a6b6e2081 100644
--- a/lib/Format/Format.cpp
+++ b/lib/Format/Format.cpp
@@ -808,9 +808,8 @@ private:
TokenAnnotation &Annotation = Annotations[i];
const FormatToken &Tok = Line.Tokens[i];
- if (getPrecedence(Tok) == prec::Assignment)
- IsRHS = true;
- else if (Tok.Tok.is(tok::kw_return))
+ if (getPrecedence(Tok) == prec::Assignment ||
+ Tok.Tok.is(tok::kw_return) || Tok.Tok.is(tok::kw_throw))
IsRHS = true;
if (Annotation.Type != TT_Unknown)