owenca wrote: Let's leave `None` alone and add `ExceptShortType`, e.g.: ``` --- a/clang/lib/Format/ContinuationIndenter.cpp +++ b/clang/lib/Format/ContinuationIndenter.cpp @@ -329,12 +329,18 @@ bool ContinuationIndenter::canBreak(const LineState &State) { // Don't break after very short return types (e.g. "void") as that is often // unexpected. if (Current.is(TT_FunctionDeclarationName) && State.Column < 6) { if (Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_None) return false; } + if (Current.is(TT_FunctionDeclarationName) && + Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_ExceptShortType) { + assert(State.Column >= State.FirstIndent); + if (State.Column - State.FirstIndent < 6) + return false; + } // If binary operators are moved to the next line (including commas for some // styles of constructor initializers), that's always ok. if (!Current.isOneOf(TT_BinaryOperator, tok::comma) && // Allow breaking opening brace of lambdas (when passed as function // arguments) to a new line when BeforeLambdaBody brace wrapping is ```
https://github.com/llvm/llvm-project/pull/78011 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits