Formatter: Add tests for try/catch. Let 'throw' start an expression.
Before:
throw a *b;
Now:
throw a * b;
llvm-svn: 171754
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 8faa93c..7a6b6e2 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -808,9 +808,8 @@
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)