diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 694078b3c3c..9ed92d367d0 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -161,7 +161,9 @@ clang::format::FormatStyle calculateQtcStyle() 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; @@ -169,8 +171,12 @@ clang::format::FormatStyle calculateQtcStyle() 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;