diff options
author | Daniel Jasper <djasper@google.com> | 2014-11-14 12:31:14 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2014-11-14 12:31:14 +0000 |
commit | 119ff533e4c37a85782c6ffe121e391d063218bd (patch) | |
tree | f80bfd1bc36b2bdf5b9b09e28ecbfd16678ec48b /clang/lib/Format/ContinuationIndenter.cpp | |
parent | cee13a2712c3ac3134791f951157011411e798d8 (diff) | |
download | bcm5719-llvm-119ff533e4c37a85782c6ffe121e391d063218bd.tar.gz bcm5719-llvm-119ff533e4c37a85782c6ffe121e391d063218bd.zip |
clang-format: Improve indentation of comments in expressions.
Before:
int i = (a)
// comment
+ b;
return aaaa == bbbb
// comment
? aaaa
: bbbb;
After:
int i = (a)
// comment
+ b;
return aaaa == bbbb
// comment
? aaaa
: bbbb;
llvm-svn: 221985
Diffstat (limited to 'clang/lib/Format/ContinuationIndenter.cpp')
-rw-r--r-- | clang/lib/Format/ContinuationIndenter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 9e6014a6837..7fdc1af09b7 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -594,7 +594,7 @@ unsigned ContinuationIndenter::getNewLineColumn(const LineState &State) { if (NextNonComment->Type == TT_CtorInitializerComma) return State.Stack.back().Indent; if (Previous.is(tok::r_paren) && !Current.isBinaryOperator() && - Current.isNot(tok::colon)) + !Current.isOneOf(tok::colon, tok::comment)) return ContinuationIndent; if (State.Stack.back().Indent == State.FirstIndent && PreviousNonComment && PreviousNonComment->isNot(tok::r_brace)) |