From f175ec933f1c5c5d7a345edbaacc8ff90202aee2 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 1 Jul 2024 12:08:13 +0200 Subject: [PATCH] ClangFormat: Fix build with current LLVM main branch Change-Id: I27b3fb41091aeeeda0bdb4786d8f1793beb0376f Reviewed-by: Artem Sokolovskii --- src/plugins/clangformat/clangformatutils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 7beb062a45e..9e3444b2475 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -113,7 +113,11 @@ clang::format::FormatStyle calculateQtcStyle() style.IndentWrappedFunctionNames = false; style.JavaScriptQuotes = FormatStyle::JSQS_Leave; style.JavaScriptWrapImports = true; +#if LLVM_VERSION_MAJOR >= 19 + style.KeepEmptyLines = {false, false, false}; +#else style.KeepEmptyLinesAtTheStartOfBlocks = false; +#endif // Do not add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE as this will indent lines in between. style.MacroBlockBegin = ""; style.MacroBlockEnd = "";