From 7457b623125f4bcdb7941769a385cfbfc0dcbf2b Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 8 Nov 2024 12:50:30 +0100 Subject: [PATCH] ClangFormat: Fix warning on uninitialized struct member Clang 18's AlignConsecutiveStyle has a new bool AlignFunctionPointers member. Change-Id: I5d72d9caa4a6e58ffa09674d2d3b976a95ea5dd0 Reviewed-by: Christian Kandeler --- src/plugins/clangformat/clangformatutils.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- qt-creator-opensource-src-4.15.2/src/plugins/clangformat/clangformatutils.cpp.old 2024-12-04 16:32:21.224382015 -0600 +++ qt-creator-opensource-src-4.15.2/src/plugins/clangformat/clangformatutils.cpp 2024-12-04 17:12:21.181020408 -0600 @@ -51,7 +51,13 @@ style.Language = FormatStyle::LK_Cpp; style.AccessModifierOffset = -4; style.AlignAfterOpenBracket = FormatStyle::BAS_Align; -#if LLVM_VERSION_MAJOR >= 12 +#if LLVM_VERSION_MAJOR >= 18 + style.AlignConsecutiveAssignments = {false, false, false, false, false, false}; + style.AlignConsecutiveDeclarations = {false, false, false, false, false, false}; +#elif LLVM_VERSION_MAJOR >= 15 + style.AlignConsecutiveAssignments = {false, false, false, false, false}; + style.AlignConsecutiveDeclarations = {false, false, false, false, false}; +#elif LLVM_VERSION_MAJOR >= 12 style.AlignConsecutiveAssignments = FormatStyle::ACS_None; style.AlignConsecutiveDeclarations = FormatStyle::ACS_None; #else