summaryrefslogtreecommitdiffstats
path: root/external/meta-qt5/recipes-qt/qt5/qt5-creator/0001-clangformat-AllowShortIfStatementsOnASingleLine-is-n.patch
diff options
context:
space:
mode:
Diffstat (limited to 'external/meta-qt5/recipes-qt/qt5/qt5-creator/0001-clangformat-AllowShortIfStatementsOnASingleLine-is-n.patch')
-rw-r--r--external/meta-qt5/recipes-qt/qt5/qt5-creator/0001-clangformat-AllowShortIfStatementsOnASingleLine-is-n.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/external/meta-qt5/recipes-qt/qt5/qt5-creator/0001-clangformat-AllowShortIfStatementsOnASingleLine-is-n.patch b/external/meta-qt5/recipes-qt/qt5/qt5-creator/0001-clangformat-AllowShortIfStatementsOnASingleLine-is-n.patch
new file mode 100644
index 00000000..7338f02b
--- /dev/null
+++ b/external/meta-qt5/recipes-qt/qt5/qt5-creator/0001-clangformat-AllowShortIfStatementsOnASingleLine-is-n.patch
@@ -0,0 +1,53 @@
+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(-)
+
+--- a/src/plugins/clangformat/clangformatutils.cpp
++++ b/src/plugins/clangformat/clangformatutils.cpp
+@@ -57,10 +57,18 @@ static clang::format::FormatStyle qtcSty
+ style.AlignOperands = true;
+ style.AlignTrailingComments = true;
+ style.AllowAllParametersOfDeclarationOnNextLine = true;
++#if Q_CC_CLANG < 1000
+ style.AllowShortBlocksOnASingleLine = false;
++#else
++ style.AllowShortBlocksOnASingleLine = FormatStyle::SBS_Never;
++#endif
+ style.AllowShortCaseLabelsOnASingleLine = false;
+ style.AllowShortFunctionsOnASingleLine = FormatStyle::SFS_Inline;
++#if Q_CC_CLANG < 900
+ style.AllowShortIfStatementsOnASingleLine = false;
++#else
++ style.AllowShortIfStatementsOnASingleLine = FormatStyle::SIS_Never;
++#endif
+ style.AllowShortLoopsOnASingleLine = false;
+ style.AlwaysBreakAfterReturnType = FormatStyle::RTBS_None;
+ style.AlwaysBreakBeforeMultilineStrings = false;
+@@ -68,7 +76,11 @@ static clang::format::FormatStyle qtcSty
+ style.BinPackArguments = false;
+ style.BinPackParameters = false;
+ style.BraceWrapping.AfterClass = true;
++#if Q_CC_CLANG < 1000
+ style.BraceWrapping.AfterControlStatement = false;
++#else
++ style.BraceWrapping.AfterControlStatement = FormatStyle::BWACS_Never;
++#endif
+ style.BraceWrapping.AfterEnum = false;
+ style.BraceWrapping.AfterFunction = true;
+ style.BraceWrapping.AfterNamespace = false;