diff options
author | Daniel Jasper <djasper@google.com> | 2014-12-03 14:02:59 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-12-03 14:02:59 +0000 |
commit | c095663ec10d8e9bcbf822156e56f6789ebe21a1 (patch) | |
tree | d500681a1b53c6edf43ef7db393207d0093dc3b0 /clang/lib/Format/TokenAnnotator.cpp | |
parent | 7395cae005886f4ed15713e45d7acfd2c3f33593 (diff) | |
download | bcm5719-llvm-c095663ec10d8e9bcbf822156e56f6789ebe21a1.tar.gz bcm5719-llvm-c095663ec10d8e9bcbf822156e56f6789ebe21a1.zip |
clang-format: Fix fake parentheses placement with comments.
Before:
return (a > b
// comment1
// comment2
|| c);
After:
return (a > b
// comment1
// comment2
|| c);
llvm-svn: 223234
Diffstat (limited to 'clang/lib/Format/TokenAnnotator.cpp')
-rw-r--r-- | clang/lib/Format/TokenAnnotator.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/TokenAnnotator.cpp b/clang/lib/Format/TokenAnnotator.cpp index 3b04e49ba51..9b215dcd473 100644 --- a/clang/lib/Format/TokenAnnotator.cpp +++ b/clang/lib/Format/TokenAnnotator.cpp @@ -1217,7 +1217,7 @@ private: Start->StartsBinaryExpression = true; if (Current) { FormatToken *Previous = Current->Previous; - if (Previous->is(tok::comment) && Previous->Previous) + while (Previous->is(tok::comment) && Previous->Previous) Previous = Previous->Previous; ++Previous->FakeRParens; if (Precedence > prec::Unknown) |