From 3eb341c4783bab96c1c2984d917b43edab47719c Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Tue, 11 Nov 2014 23:04:51 +0000 Subject: clang-format: Improve handling of comments in binary expressions. Before: b = a && // Comment b.c && d; After: b = a && // Comment b.c && d; This fixes llvm.org/PR21535. llvm-svn: 221727 --- clang/lib/Format/TokenAnnotator.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'clang/lib') diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 715cbf0a483..8ec8f58d147 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1149,8 +1149,7 @@ public: Current->OperatorIndex = OperatorIndex; ++OperatorIndex; } - - next(/*SkipPastLeadingComments=*/false); + next(/*SkipPastLeadingComments=*/Precedence > 0); } } } -- cgit v1.2.3