Clang: Fix build with Clang/LLVM 10

Change-Id: I740286c9dcfd325b1c31ab863fb5c91bf9c6ec70
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Orgad Shaneh
2020-02-17 23:21:17 +02:00
committed by Orgad Shaneh
parent 79612417e3
commit 44023c8f43
9 changed files with 92 additions and 21 deletions

View File

@@ -57,7 +57,11 @@ static clang::format::FormatStyle qtcStyle()
style.AlignOperands = true;
style.AlignTrailingComments = true;
style.AllowAllParametersOfDeclarationOnNextLine = true;
#if LLVM_VERSION_MAJOR >= 10
style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never;
#else
style.AllowShortBlocksOnASingleLine = false;
#endif
style.AllowShortCaseLabelsOnASingleLine = false;
style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
#if LLVM_VERSION_MAJOR >= 9
@@ -72,7 +76,11 @@ static clang::format::FormatStyle qtcStyle()
style.BinPackArguments = false;
style.BinPackParameters = false;
style.BraceWrapping.AfterClass = true;
#if LLVM_VERSION_MAJOR >= 10
style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Never;
#else
style.BraceWrapping.AfterControlStatement = false;
#endif
style.BraceWrapping.AfterEnum = false;
style.BraceWrapping.AfterFunction = true;
style.BraceWrapping.AfterNamespace = false;