From 9ad9e49ccf6e0d7f4ba5765cff3af63fbbed60e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= Date: Wed, 2 Aug 2023 12:39:13 +0200 Subject: [PATCH] clang-format: Fix build with LLVM 17 Change-Id: Ie6377be3be4a8c785d53f1eceabcc4811db4229d Reviewed-by: Christian Kandeler --- src/plugins/clangformat/clangformatutils.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 928d30d241e..1aae91a186f 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -165,7 +165,9 @@ clang::format::FormatStyle qtcStyle() style.SpaceAfterTemplateKeyword = false; style.SpaceBeforeAssignmentOperators = true; style.SpaceBeforeParens = FormatStyle::SBPO_ControlStatements; +#if LLVM_VERSION_MAJOR < 17 style.SpaceInEmptyParentheses = false; +#endif style.SpacesBeforeTrailingComments = 1; #if LLVM_VERSION_MAJOR >= 13 style.SpacesInAngles = FormatStyle::SIAS_Never; @@ -173,8 +175,12 @@ clang::format::FormatStyle qtcStyle() style.SpacesInAngles = false; #endif style.SpacesInContainerLiterals = false; +#if LLVM_VERSION_MAJOR >= 17 + style.SpacesInParens = FormatStyle::SIPO_Never; +#else style.SpacesInCStyleCastParentheses = false; style.SpacesInParentheses = false; +#endif style.SpacesInSquareBrackets = false; addQtcStatementMacros(style); style.Standard = FormatStyle::LS_Cpp11;