summaryrefslogtreecommitdiff
path: root/user/qt-creator/llvm19.patch
blob: 7dff56df45ebb79a371e1d4c8de1a7dff89090a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
From cc9ffdb685119a7c11248f08cf88308927252b85 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= <bjoern@hazardy.de>
Date: Tue, 30 Apr 2024 16:06:28 +0200
Subject: [PATCH] ClangFormat: Fix compiliation with LLVM19

Change-Id: I4b166da2e477ffd101a5c4b9aa07c710f7698da9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
---
 src/plugins/clangformat/clangformatbaseindenter.cpp | 4 ++++
 src/plugins/clangformat/llvmfilesystem.h            | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/plugins/clangformat/clangformatbaseindenter.cpp b/src/plugins/clangformat/clangformatbaseindenter.cpp
index 1d5dc2730c3..b491bd293f1 100644
--- a/src/plugins/clangformat/clangformatbaseindenter.cpp
+++ b/src/plugins/clangformat/clangformatbaseindenter.cpp
@@ -73,7 +73,11 @@ static void adjustFormatStyleForLineBreak(clang::format::FormatStyle &style,
 
 static llvm::StringRef clearExtraNewline(llvm::StringRef text)
 {
+#if LLVM_VERSION_MAJOR >= 16
+    while (text.starts_with("\n\n"))
+#else
     while (text.startswith("\n\n"))
+#endif
         text = text.drop_front();
     return text;
 }