ClangFormat: Fix compile against latest llvm main branch

Change-Id: I6fe414721103d00eb3212040c1aafa2ef123b9d1
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
David Schulz
2024-02-27 08:34:28 +01:00
parent 4dcba2ad25
commit 82399ac9c5

View File

@@ -59,9 +59,14 @@ clang::format::FormatStyle calculateQtcStyle()
style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline; style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never; style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never;
style.AllowShortLoopsOnASingleLine = false; style.AllowShortLoopsOnASingleLine = false;
style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None;
style.AlwaysBreakBeforeMultilineStrings = false; style.AlwaysBreakBeforeMultilineStrings = false;
#if LLVM_VERSION_MAJOR >= 19
style.BreakAfterReturnType = FormatStyle::RTBS_None;
style.BreakTemplateDeclarations = FormatStyle::BTDS_Yes;
#else
style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None;
style.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes; style.AlwaysBreakTemplateDeclarations = FormatStyle::BTDS_Yes;
#endif
style.BinPackArguments = false; style.BinPackArguments = false;
style.BinPackParameters = false; style.BinPackParameters = false;
style.BraceWrapping.AfterClass = true; style.BraceWrapping.AfterClass = true;