[clang] [clang-format] Add option AllowShortRecordOnASingleLine (PR #154580)

Tomáš Slanina via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 27 04:27:58 PDT 2025


================
@@ -1553,6 +1563,7 @@ FormatStyle getLLVMStyle(FormatStyle::LanguageKind Language) {
   LLVMStyle.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_All;
   LLVMStyle.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never;
   LLVMStyle.AllowShortLambdasOnASingleLine = FormatStyle::SLS_All;
+  LLVMStyle.AllowShortRecordOnASingleLine = FormatStyle::SRS_Never;
----------------
itzexpoexpo wrote:

If it's set to `Empty` in LLVM style it will be set to `Empty` in this config too, hence the record will be merged without the user knowing about the change. This is why I used `Never` as default and made sure it's not explicitly overriding any existing behavior - making it an opt-in feature.

https://github.com/llvm/llvm-project/pull/154580


More information about the cfe-commits mailing list