From 25e7b2c5d608f71aba694224e5160fc430731b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= Date: Fri, 29 Jan 2021 18:01:37 +0100 Subject: [PATCH] clangformat: Fix build with LLVM 12 Change-Id: I493afce92b16291cf66fc510129f2154a7162847 Reviewed-by: David Schulz Fixes: | ../../../../git/src/plugins/clangformat/clangformatutils.cpp: In function 'clang::format::FormatStyle ClangFormat::qtcStyle()': | ../../../../git/src/plugins/clangformat/clangformatutils.cpp:54:41: error: cannot convert 'bool' to 'clang::format::FormatStyle::AlignConsecutiveStyle' in assignment | 54 | style.AlignConsecutiveAssignments = false; | | ^~~~~ | ../../../../git/src/plugins/clangformat/clangformatutils.cpp:55:42: error: cannot convert 'bool' to 'clang::format::FormatStyle::AlignConsecutiveStyle' in assignment | 55 | style.AlignConsecutiveDeclarations = false; | | ^~~~~ Signed-off-by: Andreas Müller Upstream-Status: Backport --- src/plugins/clangformat/clangformatutils.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp index 8e11c15364..a249327d0e 100644 --- a/src/plugins/clangformat/clangformatutils.cpp +++ b/src/plugins/clangformat/clangformatutils.cpp @@ -51,8 +51,13 @@ static clang::format::FormatStyle qtcStyle() style.Language = FormatStyle::LK_Cpp; style.AccessModifierOffset = -4; style.AlignAfterOpenBracket = FormatStyle::BAS_Align; +#if LLVM_VERSION_MAJOR >= 12 + style.AlignConsecutiveAssignments = FormatStyle::ACS_None; + style.AlignConsecutiveDeclarations = FormatStyle::ACS_None; +#else style.AlignConsecutiveAssignments = false; style.AlignConsecutiveDeclarations = false; +#endif style.AlignEscapedNewlines = FormatStyle::ENAS_DontAlign; #if LLVM_VERSION_MAJOR >= 11 style.AlignOperands = FormatStyle::OAS_Align; -- 2.30.2