aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2019-09-03 13:34:32 -0700
committerMartin Jansa <Martin.Jansa@gmail.com>2019-09-06 18:16:56 +0000
commiteb636118665bec2a869baf2a626bac2d9d40ab22 (patch)
tree816e9103adfb4a98883eb70dd609f68a372c77fb
parent12ea469918bcb73605b9c1e5080351f1189c0f17 (diff)
qt5-creator: Fix clangformat with clang 9.x
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--recipes-qt/qt5/qt5-creator/0001-clangformat-AllowShortIfStatementsOnASingleLine-is-n.patch36
-rw-r--r--recipes-qt/qt5/qt5-creator_git.bb1
2 files changed, 37 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qt5-creator/0001-clangformat-AllowShortIfStatementsOnASingleLine-is-n.patch b/recipes-qt/qt5/qt5-creator/0001-clangformat-AllowShortIfStatementsOnASingleLine-is-n.patch
new file mode 100644
index 00000000..1bc3632d
--- /dev/null
+++ b/recipes-qt/qt5/qt5-creator/0001-clangformat-AllowShortIfStatementsOnASingleLine-is-n.patch
@@ -0,0 +1,36 @@
+From 453c075b67b9d9254bf7331e1e3be287f240a9e0 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Tue, 3 Sep 2019 13:31:12 -0700
+Subject: [PATCH] clangformat: AllowShortIfStatementsOnASingleLine is not
+ boolean anymore
+
+https://reviews.llvm.org/D59087 has implemented multiple states for AllowShortIfStatementsOnASingleLine
+
+Fixes
+../../../../git/src/plugins/clangformat/clangformatutils.cpp:63:49: error: assigning to 'clang::format::FormatStyle::ShortIfStyle' from incompatible type 'bool'
+ style.AllowShortIfStatementsOnASingleLine = false;
+ ^~~~~
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ src/plugins/clangformat/clangformatutils.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/plugins/clangformat/clangformatutils.cpp b/src/plugins/clangformat/clangformatutils.cpp
+index 09a3150c89..7d8a95ae18 100644
+--- a/src/plugins/clangformat/clangformatutils.cpp
++++ b/src/plugins/clangformat/clangformatutils.cpp
+@@ -60,7 +60,7 @@ static clang::format::FormatStyle qtcStyle()
+ style.AllowShortBlocksOnASingleLine = false;
+ style.AllowShortCaseLabelsOnASingleLine = false;
+ style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
+- style.AllowShortIfStatementsOnASingleLine = false;
++ style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never;
+ style.AllowShortLoopsOnASingleLine = false;
+ style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None;
+ style.AlwaysBreakBeforeMultilineStrings = false;
+--
+2.23.0
+
diff --git a/recipes-qt/qt5/qt5-creator_git.bb b/recipes-qt/qt5/qt5-creator_git.bb
index 107fee53..a3960042 100644
--- a/recipes-qt/qt5/qt5-creator_git.bb
+++ b/recipes-qt/qt5/qt5-creator_git.bb
@@ -25,6 +25,7 @@ PV = "4.9.2+git${SRCPV}"
# 4.9.2.meta-qt5.1
SRC_URI = " \
git://code.qt.io/qt-creator/qt-creator.git;branch=4.9 \
+ file://0001-clangformat-AllowShortIfStatementsOnASingleLine-is-n.patch \
"
SRC_URI_append_libc-musl = " file://0001-Link-with-libexecinfo-on-musl.patch"