diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Format/Format.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/Format/Format.cpp b/clang/lib/Format/Format.cpp index 548bdee2b2d..57e9a769892 100644 --- a/clang/lib/Format/Format.cpp +++ b/clang/lib/Format/Format.cpp @@ -1060,7 +1060,10 @@ private: /// \brief Determine whether ++/-- are pre- or post-increments/-decrements. TokenType determineIncrementUsage(const AnnotatedToken &Tok) { - if (Tok.Parent != NULL && Tok.Parent->is(tok::identifier)) + if (Tok.Parent == NULL) + return TT_UnaryOperator; + if (Tok.Parent->is(tok::r_paren) || Tok.Parent->is(tok::r_square) || + Tok.Parent->is(tok::identifier)) return TT_TrailingUnaryOperator; return TT_UnaryOperator; |