Skip to content

Commit 42c82fc

Browse files
authored
[libc++] Upgrade to GCC 15 (#138293)
1 parent fad1972 commit 42c82fc

File tree

30 files changed

+119
-17
lines changed

30 files changed

+119
-17
lines changed

.github/workflows/libcxx-build-and-test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ jobs:
5252
cxx: [ 'clang++-21' ]
5353
include:
5454
- config: 'generic-gcc'
55-
cc: 'gcc-14'
56-
cxx: 'g++-14'
55+
cc: 'gcc-15'
56+
cxx: 'g++-15'
5757
steps:
5858
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
5959
- name: ${{ matrix.config }}.${{ matrix.cxx }}
@@ -92,8 +92,8 @@ jobs:
9292
cxx: [ 'clang++-21' ]
9393
include:
9494
- config: 'generic-gcc-cxx11'
95-
cc: 'gcc-14'
96-
cxx: 'g++-14'
95+
cc: 'gcc-15'
96+
cxx: 'g++-15'
9797
- config: 'generic-cxx26'
9898
cc: 'clang-20'
9999
cxx: 'clang++-20'

libcxx/docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Compiler Versions Restrictions Support policy
135135
Clang 19, 20, 21-git latest two stable releases per `LLVM's release page <https://releases.llvm.org>`_ and the development version
136136
AppleClang 15 latest stable release per `Xcode's release page <https://developer.apple.com/documentation/xcode-release-notes>`_
137137
Open XL 17.1.3 (AIX) latest stable release per `Open XL's documentation page <https://www.ibm.com/docs/en/openxl-c-and-cpp-aix>`_
138-
GCC 14 In C++11 or later only latest stable release per `GCC's release page <https://gcc.gnu.org/releases.html>`_
138+
GCC 15 In C++11 or later only latest stable release per `GCC's release page <https://gcc.gnu.org/releases.html>`_
139139
============ =================== ========================== =====================
140140

141141
Libc++ also supports common platforms and architectures:

libcxx/src/experimental/time_zone.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,15 @@
2929
// These quirks often use a 12h interval; this is the scan interval of zdump,
3030
// which implies there are no sys_info objects with a duration of less than 12h.
3131

32+
// Work around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120502
33+
34+
#include <__config>
35+
36+
// TODO(LLVM 23): When upgrading to GCC 16 this can be removed
37+
#ifdef _LIBCPP_COMPILER_GCC
38+
# pragma GCC optimize("-O0")
39+
#endif
40+
3241
#include <algorithm>
3342
#include <cctype>
3443
#include <chrono>

libcxx/test/std/algorithms/alg.nonmodifying/alg.contains/ranges.contains.pass.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ constexpr bool test() {
195195
std::string a[] = {str1, str1, str, str1, str1};
196196
auto whole =
197197
std::ranges::subrange(forward_iterator(std::move_iterator(a)), forward_iterator(std::move_iterator(a + 5)));
198-
bool ret = std::ranges::contains(whole.begin(), whole.end(), "hello world", [&](const std::string i) {
198+
bool ret = std::ranges::contains(whole.begin(), whole.end(), +"hello world", [&](const std::string i) {
199199
++projection_count;
200200
return i;
201201
});
@@ -207,7 +207,7 @@ constexpr bool test() {
207207
std::string a[] = {str1, str1, str, str1, str1};
208208
auto whole =
209209
std::ranges::subrange(forward_iterator(std::move_iterator(a)), forward_iterator(std::move_iterator(a + 5)));
210-
bool ret = std::ranges::contains(whole, "hello world", [&](const std::string i) {
210+
bool ret = std::ranges::contains(whole, +"hello world", [&](const std::string i) {
211211
++projection_count;
212212
return i;
213213
});

libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable.compile.pass.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <vector>
2727

2828
#include "compare_types.h"
29+
#include "test_macros.h"
2930

3031
namespace fundamentals {
3132
static_assert(std::equality_comparable<int>);
@@ -43,7 +44,12 @@ static_assert(std::equality_comparable<unsigned char&&>);
4344
static_assert(std::equality_comparable<unsigned short const&&>);
4445
static_assert(std::equality_comparable<unsigned int volatile&&>);
4546
static_assert(std::equality_comparable<unsigned long const volatile&&>);
47+
// Array comparisons are ill-formed in C++26, but Clang doesn't implement this yet.
48+
#if TEST_STD_VER <= 23 || defined(TEST_COMPILER_CLANG)
4649
static_assert(std::equality_comparable<int[5]>);
50+
#else
51+
static_assert(!std::equality_comparable<int[5]>);
52+
#endif
4753
static_assert(std::equality_comparable<int (*)(int)>);
4854
static_assert(std::equality_comparable<int (&)(int)>);
4955
static_assert(std::equality_comparable<int (*)(int) noexcept>);

libcxx/test/std/concepts/concepts.compare/concept.equalitycomparable/equality_comparable_with.compile.pass.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,12 @@ static_assert(!check_equality_comparable_with < int,
107107
int (S::*)() const volatile&& noexcept > ());
108108

109109
static_assert(check_equality_comparable_with<int*, int*>());
110+
// Array comparisons are ill-formed in C++26, but Clang doesn't implement this yet.
111+
#if TEST_STD_VER <= 23 || defined(TEST_COMPILER_CLANG)
110112
static_assert(check_equality_comparable_with<int*, int[5]>());
113+
#else
114+
static_assert(!check_equality_comparable_with<int*, int[5]>());
115+
#endif
111116
static_assert(!check_equality_comparable_with<int*, int (*)()>());
112117
static_assert(!check_equality_comparable_with<int*, int (&)()>());
113118
static_assert(!check_equality_comparable_with<int*, int (S::*)()>());
@@ -148,7 +153,12 @@ static_assert(
148153
static_assert(!check_equality_comparable_with < int*,
149154
int (S::*)() const volatile&& noexcept > ());
150155

156+
// Array comparisons are ill-formed in C++26, but Clang doesn't implement this yet.
157+
#if TEST_STD_VER <= 23 || defined(TEST_COMPILER_CLANG)
151158
static_assert(check_equality_comparable_with<int[5], int[5]>());
159+
#else
160+
static_assert(!check_equality_comparable_with<int[5], int[5]>());
161+
#endif
152162
static_assert(!check_equality_comparable_with<int[5], int (*)()>());
153163
static_assert(!check_equality_comparable_with<int[5], int (&)()>());
154164
static_assert(!check_equality_comparable_with<int[5], int (S::*)()>());
@@ -942,7 +952,12 @@ static_assert(
942952

943953
static_assert(!check_equality_comparable_with<std::nullptr_t, int>());
944954
static_assert(check_equality_comparable_with<std::nullptr_t, int*>());
955+
// Array comparisons are ill-formed in C++26, but Clang doesn't implement this yet.
956+
#if TEST_STD_VER <= 23 || defined(TEST_COMPILER_CLANG)
945957
static_assert(check_equality_comparable_with<std::nullptr_t, int[5]>());
958+
#else
959+
static_assert(!check_equality_comparable_with<std::nullptr_t, int[5]>());
960+
#endif
946961
static_assert(check_equality_comparable_with<std::nullptr_t, int (*)()>());
947962
static_assert(check_equality_comparable_with<std::nullptr_t, int (&)()>());
948963
static_assert(check_equality_comparable_with<std::nullptr_t, int (S::*)()>());

libcxx/test/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered.compile.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ static_assert(models_totally_ordered<unsigned char&&>());
5555
static_assert(models_totally_ordered<unsigned short const&&>());
5656
static_assert(models_totally_ordered<unsigned int volatile&&>());
5757
static_assert(models_totally_ordered<unsigned long const volatile&&>());
58+
// Array comparisons are ill-formed in C++26
59+
#if TEST_STD_VER <= 23
5860
static_assert(models_totally_ordered<int[5]>());
61+
#endif
5962
static_assert(models_totally_ordered<int (*)(int)>());
6063
static_assert(models_totally_ordered<int (&)(int)>());
6164
static_assert(models_totally_ordered<int (*)(int) noexcept>());

libcxx/test/std/concepts/concepts.compare/concepts.totallyordered/totally_ordered_with.compile.pass.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,12 @@ static_assert(!check_totally_ordered_with<int, int (S::*)() const volatile&&>())
8989
static_assert(!check_totally_ordered_with < int, int (S::*)() const volatile&& noexcept > ());
9090

9191
static_assert(check_totally_ordered_with<int*, int*>());
92+
// Array comparisons are ill-formed in C++26, but Clang doesn't implement this yet.
93+
#if TEST_STD_VER <= 23 || defined(TEST_COMPILER_CLANG)
9294
static_assert(check_totally_ordered_with<int*, int[5]>());
95+
#else
96+
static_assert(!check_totally_ordered_with<int*, int[5]>());
97+
#endif
9398
static_assert(!check_totally_ordered_with<int*, int (*)()>());
9499
static_assert(!check_totally_ordered_with<int*, int (&)()>());
95100
static_assert(!check_totally_ordered_with<int*, int (S::*)()>());
@@ -117,7 +122,12 @@ static_assert(!check_totally_ordered_with < int*, int (S::*)() volatile&& noexce
117122
static_assert(!check_totally_ordered_with<int*, int (S::*)() const volatile&&>());
118123
static_assert(!check_totally_ordered_with < int*, int (S::*)() const volatile&& noexcept > ());
119124

125+
// Array comparisons are ill-formed in C++26, but Clang doesn't implement this yet.
126+
#if TEST_STD_VER <= 23 || defined(TEST_COMPILER_CLANG)
120127
static_assert(check_totally_ordered_with<int[5], int[5]>());
128+
#else
129+
static_assert(!check_totally_ordered_with<int[5], int[5]>());
130+
#endif
121131
static_assert(!check_totally_ordered_with<int[5], int (*)()>());
122132
static_assert(!check_totally_ordered_with<int[5], int (&)()>());
123133
static_assert(!check_totally_ordered_with<int[5], int (S::*)()>());

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new.size.except.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
// UNSUPPORTED: no-exceptions
1010
// UNSUPPORTED: sanitizer-new-delete
1111

12+
// GCC warns about allocating numeric_limits<size_t>::max() being too large (which we test here)
13+
// ADDITIONAL_COMPILE_FLAGS(gcc): -Wno-alloc-size-larger-than
14+
1215
#include <new>
1316
#include <cassert>
1417
#include <limits>

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new.size.pass.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
// asan and msan will not call the new handler.
1212
// UNSUPPORTED: sanitizer-new-delete
1313

14+
// GCC warns about allocating numeric_limits<size_t>::max() being too large (which we test here)
15+
// ADDITIONAL_COMPILE_FLAGS(gcc): -Wno-alloc-size-larger-than
16+
1417
#include <new>
1518
#include <cstddef>
1619
#include <cassert>

0 commit comments

Comments
 (0)