summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2024-06-12 19:00:37 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-06-18 08:44:41 +0100
commit5cb8d9464452744d8a8602c4748fac766bdad57c (patch)
tree82c9d4b2462f04f8505aa2e45f9ff835eac4e008
parentc79c8ce71c751518ba21e3a2aac3b231da89b610 (diff)
downloadpoky-5cb8d9464452744d8a8602c4748fac766bdad57c.tar.gz
gcc: Fix typo in increment expression in unicode from libstdc++
This issue is seen when libstdc++ headers are used by clang18 see - https://github.com/llvm/llvm-project/issues/92586 (From OE-Core rev: 1506b779014b09ffd618b2e5d95aa00ff91d6f45) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/gcc/gcc-14.1.inc1
-rw-r--r--meta/recipes-devtools/gcc/gcc/0026-libstdc-Fix-typo-in-_Grapheme_cluster_view-_Iterator.patch76
2 files changed, 77 insertions, 0 deletions
diff --git a/meta/recipes-devtools/gcc/gcc-14.1.inc b/meta/recipes-devtools/gcc/gcc-14.1.inc
index b057e570f3..17a9c51d71 100644
--- a/meta/recipes-devtools/gcc/gcc-14.1.inc
+++ b/meta/recipes-devtools/gcc/gcc-14.1.inc
@@ -68,6 +68,7 @@ SRC_URI = "${BASEURI} \
68 file://0023-Fix-install-path-of-linux64.h.patch \ 68 file://0023-Fix-install-path-of-linux64.h.patch \
69 file://0024-Avoid-hardcoded-build-paths-into-ppc-libgcc.patch \ 69 file://0024-Avoid-hardcoded-build-paths-into-ppc-libgcc.patch \
70 file://0025-gcc-testsuite-tweaks-for-mips-OE.patch \ 70 file://0025-gcc-testsuite-tweaks-for-mips-OE.patch \
71 file://0026-libstdc-Fix-typo-in-_Grapheme_cluster_view-_Iterator.patch \
71" 72"
72 73
73S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/${SOURCEDIR}" 74S = "${TMPDIR}/work-shared/gcc-${PV}-${PR}/${SOURCEDIR}"
diff --git a/meta/recipes-devtools/gcc/gcc/0026-libstdc-Fix-typo-in-_Grapheme_cluster_view-_Iterator.patch b/meta/recipes-devtools/gcc/gcc/0026-libstdc-Fix-typo-in-_Grapheme_cluster_view-_Iterator.patch
new file mode 100644
index 0000000000..5a465b8c95
--- /dev/null
+++ b/meta/recipes-devtools/gcc/gcc/0026-libstdc-Fix-typo-in-_Grapheme_cluster_view-_Iterator.patch
@@ -0,0 +1,76 @@
1From c9e05b03c18e898be604ab90401476e9c473cc52 Mon Sep 17 00:00:00 2001
2From: Jonathan Wakely <jwakely@redhat.com>
3Date: Thu, 16 May 2024 17:15:55 +0100
4Subject: [PATCH] libstdc++: Fix typo in _Grapheme_cluster_view::_Iterator
5 [PR115119]
6
7libstdc++-v3/ChangeLog:
8
9 PR libstdc++/115119
10 * include/bits/unicode.h (_Iterator::operator++(int)): Fix typo
11 in increment expression.
12 * testsuite/ext/unicode/grapheme_view.cc: Check post-increment
13 on view's iterator.
14
15Drop it when upgrading to 14.2
16
17Upstream-Status: Backport [https://github.com/gcc-mirror/gcc/commit/c9e05b03c18e898be604ab90401476e9c473cc52]
18Signed-off-by: Khem Raj <raj.khem@gmail.com>
19---
20 libstdc++-v3/include/bits/unicode.h | 6 ++++--
21 libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc | 11 +++++++++++
22 2 files changed, 15 insertions(+), 2 deletions(-)
23
24diff --git a/libstdc++-v3/include/bits/unicode.h b/libstdc++-v3/include/bits/unicode.h
25index 46238143fb6..a14a17c5dfc 100644
26--- a/libstdc++-v3/include/bits/unicode.h
27+++ b/libstdc++-v3/include/bits/unicode.h
28@@ -34,10 +34,12 @@
29 #include <array>
30 #include <bit> // bit_width
31 #include <charconv> // __detail::__from_chars_alnum_to_val_table
32+#include <string_view>
33 #include <cstdint>
34 #include <bits/stl_algo.h>
35 #include <bits/stl_iterator.h>
36-#include <bits/ranges_base.h>
37+#include <bits/ranges_base.h> // iterator_t, sentinel_t, input_range, etc.
38+#include <bits/ranges_util.h> // view_interface
39
40 namespace std _GLIBCXX_VISIBILITY(default)
41 {
42@@ -802,7 +804,7 @@ inline namespace __v15_1_0
43 operator++(int)
44 {
45 auto __tmp = *this;
46- ++this;
47+ ++*this;
48 return __tmp;
49 }
50
51diff --git a/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc b/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc
52index ac1e8c50b05..a3bb36e14b8 100644
53--- a/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc
54+++ b/libstdc++-v3/testsuite/ext/unicode/grapheme_view.cc
55@@ -83,10 +83,21 @@ test_breaks()
56 VERIFY( iter == gv.end() );
57 }
58
59+constexpr void
60+test_pr115119()
61+{
62+ // PR 115119 Typo in _Grapheme_cluster_view::_Iterator::operator++(int)
63+ uc::_Grapheme_cluster_view gv(" "sv);
64+ auto it = std::ranges::begin(gv);
65+ it++;
66+ VERIFY( it == std::ranges::end(gv) );
67+}
68+
69 int main()
70 {
71 auto run_tests = []{
72 test_breaks();
73+ test_pr115119();
74 return true;
75 };
76