summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-01-04 20:46:38 +0000
committerDaniel Jasper <djasper@google.com>2013-01-04 20:46:38 +0000
commit3c2557d0dd195652c5488636e214a32203b73a6e (patch)
tree30e2972fb37e2a569f02b306419680b36fc33287 /clang/lib/Format
parent66748e93e2cc7b5799b81188126d088ce7c22f74 (diff)
downloadbcm5719-llvm-3c2557d0dd195652c5488636e214a32203b73a6e.tar.gz
bcm5719-llvm-3c2557d0dd195652c5488636e214a32203b73a6e.zip
Correctly format dereference and address of in array parameters.
Before: InvalidRegions[ &R] = 0; After: InvalidRegions[&R] = 0; This fixes llvm.org/PR14793 llvm-svn: 171522
Diffstat (limited to 'clang/lib/Format')
-rw-r--r--clang/lib/Format/Format.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp
index 69020c65750..7f40e35e1d6 100644
--- a/clang/lib/Format/Format.cpp
+++ b/clang/lib/Format/Format.cpp
@@ -878,8 +878,9 @@ private:
const FormatToken &PrevToken = Line.Tokens[Index - 1];
const FormatToken &NextToken = Line.Tokens[Index + 1];
- if (PrevToken.Tok.is(tok::l_paren) || PrevToken.Tok.is(tok::comma) ||
- PrevToken.Tok.is(tok::kw_return) || PrevToken.Tok.is(tok::colon) ||
+ if (PrevToken.Tok.is(tok::l_paren) || PrevToken.Tok.is(tok::l_square) ||
+ PrevToken.Tok.is(tok::comma) || PrevToken.Tok.is(tok::kw_return) ||
+ PrevToken.Tok.is(tok::colon) ||
Annotations[Index - 1].Type == TokenAnnotation::TT_BinaryOperator)
return TokenAnnotation::TT_UnaryOperator;
OpenPOWER on IntegriCloud