diff options
author | Daniel Jasper <djasper@google.com> | 2013-01-04 20:46:38 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-01-04 20:46:38 +0000 |
commit | 9bb0d280faaedd528d2af7eeaf06c9f262345ad2 (patch) | |
tree | 8847b7547d4cae71147f92b19ebe3708f82b49ac /lib/Format/Format.cpp | |
parent | 2b721f52655bc75f8b9d5dcc761298829d5a7c8e (diff) |
Correctly format dereference and address of in array parameters.
Before: InvalidRegions[ &R] = 0;
After: InvalidRegions[&R] = 0;
This fixes llvm.org/PR14793
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171522 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Format/Format.cpp')
-rw-r--r-- | lib/Format/Format.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Format/Format.cpp b/lib/Format/Format.cpp index 69020c6575..7f40e35e1d 100644 --- a/lib/Format/Format.cpp +++ b/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; |