clang-format: Adapt to LLVM 16

Change-Id: I2e35f92db6de10b1e4bf173f0864f0cd893a011f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Björn Schäpers
2022-11-04 07:18:50 +01:00
committed by Björn Schäpers
parent ed33e2bfb5
commit f4545807de
2 changed files with 8 additions and 0 deletions

View File

@@ -39,7 +39,11 @@ void adjustFormatStyleForLineBreak(clang::format::FormatStyle &style,
// This is a separate pass, don't do it unless it's the full formatting.
style.FixNamespaceComments = false;
#if LLVM_VERSION_MAJOR >= 16
style.AlignTrailingComments = {clang::format::FormatStyle::TCAS_Never, 0};
#else
style.AlignTrailingComments = false;
#endif
if (replacementsToKeep == ReplacementsToKeep::IndentAndBefore)
return;

View File

@@ -49,7 +49,11 @@ clang::format::FormatStyle qtcStyle()
#else
style.AlignOperands = true;
#endif
#if LLVM_VERSION_MAJOR >= 16
style.AlignTrailingComments = {FormatStyle::TCAS_Always, 0};
#else
style.AlignTrailingComments = true;
#endif
style.AllowAllParametersOfDeclarationOnNextLine = true;
#if LLVM_VERSION_MAJOR >= 10
style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never;