summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2014-12-08 21:28:31 +0000
committerDaniel Jasper <djasper@google.com>2014-12-08 21:28:31 +0000
commita536df4b28b2ab1ab495d45d674e32f5eec23a28 (patch)
treed19137ad3b3e7ac6947ba680b437c2895a7e0fdc /clang/lib
parent025f860638d20ed3c9774934f301647643ac8dc8 (diff)
downloadbcm5719-llvm-a536df4b28b2ab1ab495d45d674e32f5eec23a28.tar.gz
bcm5719-llvm-a536df4b28b2ab1ab495d45d674e32f5eec23a28.zip
clang-format: Indent correctly in conditional expressions after return.
This only applies when not aligning after the return itself (which is commonly done for C++. Before: return aaaaaaaaaa ? bbbbbbbbbb( bbbbbb) // This is indented relative to aaaaaaaaaa. : b; After: return aaaaaaaaaa ? bbbbbbbbbb( bbbbbb) : b; llvm-svn: 223694
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Format/ContinuationIndenter.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp
index 8538f9a4601..5f55e0daa06 100644
--- a/clang/lib/Format/ContinuationIndenter.cpp
+++ b/clang/lib/Format/ContinuationIndenter.cpp
@@ -766,7 +766,8 @@ void ContinuationIndenter::moveStatePastFakeLParens(LineState &State,
// ParameterToInnerFunction));
if (*I > prec::Unknown)
NewParenState.LastSpace = std::max(NewParenState.LastSpace, State.Column);
- NewParenState.StartOfFunctionCall = State.Column;
+ if (*I != prec::Conditional)
+ NewParenState.StartOfFunctionCall = State.Column;
// Always indent conditional expressions. Never indent expression where
// the 'operator' is ',', ';' or an assignment (i.e. *I <=
OpenPOWER on IntegriCloud