summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qt5-creator/0002-clangformat-Fix-build-with-LLVM-12.patch
diff options
context:
space:
mode:
authorAndreas Müller <schnitzeltony@gmail.com>2021-04-25 20:56:07 +0200
committerMartin Jansa <Martin.Jansa@gmail.com>2021-04-29 10:54:51 +0200
commit100c1dce31998a0f742ff40ff19cf82f0a8839de (patch)
tree8bb1c4273e0fbf1e2511a5d14eac70b6850c6ceb /recipes-qt/qt5/qt5-creator/0002-clangformat-Fix-build-with-LLVM-12.patch
parent08550c223c4528ed76d45a981aff65c8857b9195 (diff)
downloadmeta-qt5-100c1dce31998a0f742ff40ff19cf82f0a8839de.tar.gz
qt5-creator: Fix build with LLVM 12 / clang PACKAGECONFIG enabled
Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
Diffstat (limited to 'recipes-qt/qt5/qt5-creator/0002-clangformat-Fix-build-with-LLVM-12.patch')
-rw-r--r--recipes-qt/qt5/qt5-creator/0002-clangformat-Fix-build-with-LLVM-12.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qt5-creator/0002-clangformat-Fix-build-with-LLVM-12.patch b/recipes-qt/qt5/qt5-creator/0002-clangformat-Fix-build-with-LLVM-12.patch
new file mode 100644
index 00000000..e204d5e6
--- /dev/null
+++ b/recipes-qt/qt5/qt5-creator/0002-clangformat-Fix-build-with-LLVM-12.patch
@@ -0,0 +1,45 @@
1From 25e7b2c5d608f71aba694224e5160fc430731b6a Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= <bjoern@hazardy.de>
3Date: Fri, 29 Jan 2021 18:01:37 +0100
4Subject: [PATCH] clangformat: Fix build with LLVM 12
5
6Change-Id: I493afce92b16291cf66fc510129f2154a7162847
7Reviewed-by: David Schulz <david.schulz@qt.io>
8
9Fixes:
10| ../../../../git/src/plugins/clangformat/clangformatutils.cpp: In function 'clang::format::FormatStyle ClangFormat::qtcStyle()':
11| ../../../../git/src/plugins/clangformat/clangformatutils.cpp:54:41: error: cannot convert 'bool' to 'clang::format::FormatStyle::AlignConsecutiveStyle' in assignment
12| 54 | style.AlignConsecutiveAssignments = false;
13| | ^~~~~
14| ../../../../git/src/plugins/clangformat/clangformatutils.cpp:55:42: error: cannot convert 'bool' to 'clang::format::FormatStyle::AlignConsecutiveStyle' in assignment
15| 55 | style.AlignConsecutiveDeclarations = false;
16| | ^~~~~
17
18Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
19
20Upstream-Status: Backport
21---
22 src/plugins/clangformat/clangformatutils.cpp | 5 +++++
23 1 file changed, 5 insertions(+)
24
25diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp
26index 8e11c15364..a249327d0e 100644
27--- a/src/plugins/clangformat/clangformatutils.cpp
28+++ b/src/plugins/clangformat/clangformatutils.cpp
29@@ -51,8 +51,13 @@ static clang::format::FormatStyle qtcStyle()
30 style.Language = FormatStyle::LK_Cpp;
31 style.AccessModifierOffset = -4;
32 style.AlignAfterOpenBracket = FormatStyle::BAS_Align;
33+#if LLVM_VERSION_MAJOR >= 12
34+ style.AlignConsecutiveAssignments = FormatStyle::ACS_None;
35+ style.AlignConsecutiveDeclarations = FormatStyle::ACS_None;
36+#else
37 style.AlignConsecutiveAssignments = false;
38 style.AlignConsecutiveDeclarations = false;
39+#endif
40 style.AlignEscapedNewlines = FormatStyle::ENAS_DontAlign;
41 #if LLVM_VERSION_MAJOR >= 11
42 style.AlignOperands = FormatStyle::OAS_Align;
43--
442.30.2
45