From 988e7e4fe8b0276ae59ba1a8022f2bca3372b2f2 Mon Sep 17 00:00:00 2001 From: Daniel Jasper Date: Mon, 8 May 2017 15:07:52 +0000 Subject: [clang-format] Don’t propagate AvoidBinPacking into argument subexpressions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is an attempt to fix the issue described in a recent email: http://lists.llvm.org/pipermail/cfe-dev/2017-April/053632.html Patch by jtbandes. Thank you! Review: https://reviews.llvm.org/D32475 llvm-svn: 302427 --- clang/lib/Format/ContinuationIndenter.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'clang/lib/Format/ContinuationIndenter.cpp') diff --git a/clang/lib/Format/ContinuationIndenter.cpp b/clang/lib/Format/ContinuationIndenter.cpp index 3adb72c11da..709eeb1539a 100644 --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -920,6 +920,10 @@ void ContinuationIndenter::moveStatePastFakeLParens(LineState &State, NewParenState.NoLineBreak = NewParenState.NoLineBreak || State.Stack.back().NoLineBreakInOperand; + // Don't propagate AvoidBinPacking into subexpressions of arg/param lists. + if (*I > prec::Comma) + NewParenState.AvoidBinPacking = false; + // Indent from 'LastSpace' unless these are fake parentheses encapsulating // a builder type call after 'return' or, if the alignment after opening // brackets is disabled. -- cgit v1.2.3