[clang] [clang-format] Add AllowShortType option for AlwaysBreakAfterReturnType. (PR #78011)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 26 20:22:21 PST 2024
================
@@ -326,11 +326,13 @@ bool ContinuationIndenter::canBreak(const LineState &State) {
return false;
}
- // 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)
+ if (Style.AlwaysBreakAfterReturnType == FormatStyle::RTBS_None) {
+ // Don't break after very short return types (e.g. "void") as that is often
+ // unexpected.
+ if (Current.is(TT_FunctionDeclarationName) &&
+ State.Column - State.FirstIndent < 6) {
----------------
rmarker wrote:
Yep.
https://github.com/llvm/llvm-project/pull/78011
More information about the cfe-commits
mailing list