Patch-Source: https://github.com/qt-creator/qt-creator/commit/c7cdd55dea1f30b4d236d532bdadcf36bd174640 From c7cdd55dea1f30b4d236d532bdadcf36bd174640 Mon Sep 17 00:00:00 2001 From: Cristian Adam Date: Tue, 16 Aug 2022 21:04:39 +0200 Subject: [PATCH] ClangFormat: Fix build for LLVM 15.0.0 This fixes the CMake build of Qt Creator against LLVM 15.0.0 Change-Id: Icecd45821091c8c2b565246cb17ce5a6e5c49f36 Reviewed-by: Reviewed-by: Christian Kandeler --- src/plugins/clangformat/CMakeLists.txt | 2 ++ src/plugins/clangformat/clangformatutils.cpp | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/plugins/clangformat/CMakeLists.txt b/src/plugins/clangformat/CMakeLists.txt index 61ebc03c421..9a0d230315b 100644 --- a/src/plugins/clangformat/CMakeLists.txt +++ b/src/plugins/clangformat/CMakeLists.txt @@ -13,6 +13,8 @@ add_qtc_plugin(ClangFormat clangformatplugin.cpp clangformatplugin.h clangformatsettings.cpp clangformatsettings.h clangformatutils.cpp clangformatutils.h + EXPLICIT_MOC + clangformatconfigwidget.cpp clangformatconfigwidget.h ) if(TARGET ClangFormat) diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 230078558e5..973c1050772 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -118,7 +118,9 @@ clang::format::FormatStyle qtcStyle() style.ColumnLimit = 100; style.CommentPragmas = "^ IWYU pragma:"; style.CompactNamespaces = false; +#if LLVM_VERSION_MAJOR < 15 style.ConstructorInitializerAllOnOneLineOrOnePerLine = false; +#endif style.ConstructorInitializerIndentWidth = 4; style.ContinuationIndentWidth = 4; style.Cpp11BracedListStyle = true;