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/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 230078558e5..973c1050772 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -111,7 +111,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;