libstdc++: Do not use CTAD for _Utf32_view alias template (redux)
[official-gcc.git] / libstdc++-v3 / ChangeLog
bloba39cb174e6c528cca15ef3d7cd3c0bfb5676b25b
1 2024-01-18  Patrick Palka  <ppalka@redhat.com>
3         * include/bits/stl_pair.h [__cplusplus > 202002L]:
4         Guard P2321R2 changes with __glibcxx_ranges_zip instead.
6 2024-01-18  Patrick Palka  <ppalka@redhat.com>
8         * include/std/tuple [__cplusplus > 202002L]: Guard P2321R2
9         changes with __cpp_lib_ranges_zip instead.
11 2024-01-18  Patrick Palka  <ppalka@redhat.com>
13         PR libstdc++/109536
14         * include/debug/safe_base.h (_Safe_sequence_base::_M_swap):
15         Remove _GLIBCXX20_CONSTEXPR from non-inline member function.
16         * include/debug/safe_iterator.h
17         (_GLIBCXX20_CONSTEXPR_NON_LITERAL_SCOPE_BEGIN): Define.
18         (_GLIBCXX20_CONSTEXPR_NON_LITERAL_SCOPE_END): Define.
19         (_Safe_iterator::operator=): Use them around the code path that
20         defines a variable of type __gnu_cxx::__scoped_lock.
21         (_Safe_iterator::operator++): Likewise.
22         (_Safe_iterator::operator--): Likewise.
23         (_Safe_iterator::operator+=): Likewise.
24         (_Safe_iterator::operator-=): Likewise.
25         * testsuite/23_containers/vector/element_access/constexpr.cc
26         (test_iterators): Test more iterator operations.
27         * testsuite/23_containers/vector/bool/element_access/constexpr.cc
28         (test_iterators): Likewise.
29         * testsuite/std/ranges/adaptors/all.cc (test08) [_GLIBCXX_DEBUG]:
30         Remove.
32 2024-01-18  Jonathan Wakely  <jwakely@redhat.com>
34         * include/bits/unicode.h (__charset_alias_match): Initialize
35         __var_a and __var_b.
37 2024-01-18  Jonathan Wakely  <jwakely@redhat.com>
39         PR libstdc++/113450
40         * testsuite/std/format/functions/format.cc: Use signed char
41         instead of int8_t.
43 2024-01-17  Jonathan Wakely  <jwakely@redhat.com>
45         PR libstdc++/113318
46         * acinclude.m4 (GLIBCXX_CONFIGURE): Add c++26 directory.
47         (GLIBCXX_CHECK_TEXT_ENCODING): Define.
48         * config.h.in: Regenerate.
49         * configure: Regenerate.
50         * configure.ac: Use GLIBCXX_CHECK_TEXT_ENCODING.
51         * include/Makefile.am: Add new headers.
52         * include/Makefile.in: Regenerate.
53         * include/bits/locale_classes.h (locale::encoding): Declare new
54         member function.
55         * include/bits/unicode.h (__charset_alias_match): New function.
56         * include/bits/text_encoding-data.h: New file.
57         * include/bits/version.def (text_encoding): Define.
58         * include/bits/version.h: Regenerate.
59         * include/std/text_encoding: New file.
60         * src/Makefile.am: Add new subdirectory.
61         * src/Makefile.in: Regenerate.
62         * src/c++26/Makefile.am: New file.
63         * src/c++26/Makefile.in: New file.
64         * src/c++26/text_encoding.cc: New file.
65         * src/experimental/Makefile.am: Include c++26 convenience
66         library.
67         * src/experimental/Makefile.in: Regenerate.
68         * python/libstdcxx/v6/printers.py (StdTextEncodingPrinter): New
69         printer.
70         * scripts/gen_text_encoding_data.py: New file.
71         * testsuite/22_locale/locale/encoding.cc: New test.
72         * testsuite/ext/unicode/charset_alias_match.cc: New test.
73         * testsuite/std/text_encoding/cons.cc: New test.
74         * testsuite/std/text_encoding/members.cc: New test.
75         * testsuite/std/text_encoding/requirements.cc: New test.
77 2024-01-17  Jonathan Wakely  <jwakely@redhat.com>
79         * include/bits/unicode.h (_Grapheme_cluster_view): Require view.
80         Do not use CTAD for _Utf32_view.
81         (__format_width, __truncate): Do not use CTAD.
82         (enable_borrowed_range<_Utf_view<T, R>>): Define specialization.
83         (enable_borrowed_range<_Grapheme_cluster_view<R>>): Likewise.
85 2024-01-17  Patrick Palka  <ppalka@redhat.com>
87         * include/std/ranges (views::_CartesianProduct::operator()):
88         Adjust identity case as per P2540R1.
89         * testsuite/std/ranges/cartesian_product/1.cc (test01):
90         Adjust expected result of the identity case.
92 2024-01-15  Patrick Palka  <ppalka@redhat.com>
94         * include/std/variant (__detail::__variant::_Variadic_union):
95         Add bool __trivially_destructible template parameter.
96         (__detail::__variant::_Variadic_union::~_Variadic_union):
97         Use __trivially_destructible in constraints instead.
98         (__detail::__variant::_Variant_storage): Pass
99         __trivially_destructible value to _Variadic_union.
101 2024-01-15  Patrick Palka  <ppalka@redhat.com>
103         * include/bits/stl_iterator.h (const_iterator): Define conversion
104         operators as per P2836R1.
105         * include/bits/version.def (ranges_as_const): Update value.
106         * include/bits/version.h: Regenerate.
107         * testsuite/24_iterators/const_iterator/1.cc (test04): New test.
108         * testsuite/std/ranges/adaptors/as_const/1.cc: Adjust expected
109         value of __cpp_lib_ranges_as_const.
110         * testsuite/std/ranges/version_c++23.cc: Likewise.
112 2024-01-15  Jonathan Wakely  <jwakely@redhat.com>
114         PR libstdc++/108822
115         * include/std/tuple (__assignable, __is_nothrow_assignable):
116         Move pre-C++20 definitions adjacent to their use.
118 2024-01-15  Jonathan Wakely  <jwakely@redhat.com>
120         PR testsuite/113366
121         * include/std/format (basic_format_arg): Use __formattable
122         variable template instead of __format::__formattable_with
123         concept.
125 2024-01-15  Jonathan Wakely  <jwakely@redhat.com>
127         * src/c++20/tzdata.zi: Import new file from 2023d release.
128         * src/c++20/tzdb.cc (tzdb_list::_Node::_S_read_leap_seconds)
129         Update expiry date for leap seconds list.
131 2024-01-13  Jonathan Wakely  <jwakely@redhat.com>
133         PR libstdc++/108822
134         * include/std/tuple (tuple): Add checks for dangling references.
135         Reimplement constraints and constant expressions using C++20
136         features.
137         * include/std/type_traits [C++20]
138         (__is_implicitly_default_constructible_v): Define.
139         (__is_implicitly_default_constructible): Use variable template.
140         * testsuite/20_util/tuple/dangling_ref.cc: New test.
142 2024-01-13  Patrick Palka  <ppalka@redhat.com>
144         PR libstdc++/108827
145         PR libstdc++/111327
146         * include/bits/version.def (bind_back): Define.
147         * include/bits/version.h: Regenerate.
148         * include/std/functional (_Bind_back): Define for C++23.
149         (bind_back): Likewise.
150         * testsuite/20_util/function_objects/bind_back/1.cc: New test
151         (adapted from corresponding bind_front test).
152         * testsuite/20_util/function_objects/bind_back/111327.cc: Likewise.
154 2024-01-13  Patrick Palka  <ppalka@redhat.com>
156         * include/std/functional (_Bind_front): Remove =default special
157         member function declarations.
158         (_Bind_front::operator()): Implement using C++23 deducing this
159         when available.
160         * testsuite/20_util/function_objects/bind_front/111327.cc:
161         Adjust testcase to expect better errors in C++23 mode.
163 2024-01-13  Patrick Palka  <ppalka@redhat.com>
165         * include/std/ranges (views::__adaptor::operator|): Perform
166         perfect forwarding of arguments.
167         (views::__adaptor::_RangeAdaptor::operator()): Pass dummy
168         first argument to _Partial.
169         (views::__adaptor::_Partial::_Partial): Likewise.  Add dummy
170         first parameter.
171         (views::__adaptor::_Pipe::_Pipe): Perform perfect forwarding
172         of arguments.
173         (to): Pass dummy first argument to _Partial.
175 2024-01-13  Jonathan Wakely  <jwakely@redhat.com>
177         PR libstdc++/107466
178         * include/bits/random.tcc (subtract_with_carry_engine::seed):
179         Implement proposed resolution of LWG 4014.
180         * testsuite/26_numerics/random/pr60037-neg.cc: Adjust dg-error
181         line number.
182         * testsuite/26_numerics/random/subtract_with_carry_engine/cons/lwg3809.cc:
183         Check for expected result of 64-bit engine with seed that
184         doesn't fit in 32-bits.
186 2024-01-12  Jonathan Wakely  <jwakely@redhat.com>
188         PR libstdc++/113320
189         * include/std/format (__format::_Runtime_format_string): Add
190         constructor and disable copy operations.
191         (basic_format_string(_Runtime_format_string)): Add noexcept and
192         take parameter by value not rvalue reference.
193         (runtime_format): Add noexcept.
194         * testsuite/std/format/runtime_format.cc: Check noexcept. Check
195         that construction is only possible from prvalues, not xvalues.
197 2024-01-12  Jonathan Wakely  <jwakely@redhat.com>
199         PR libstdc++/105505
200         * include/bits/stl_pair.h (pair::pair(U1&&, U2&&)) [C++23]: Add
201         default template arguments, as per P1951R1.
202         * testsuite/20_util/pair/cons/default_tmpl_args.cc: New test.
204 2024-01-12  Jonathan Wakely  <jwakely@redhat.com>
206         * include/std/format (__format::_Arg_store): Fix PR number in
207         comment. Simplify preprocessor code.
209 2024-01-11  Jonathan Wakely  <jwakely@redhat.com>
211         * doc/xml/manual/evolution.xml: Fix spelling.
212         * doc/html/manual/api.html: Regenerate.
214 2024-01-11  Jonathan Wakely  <jwakely@redhat.com>
216         * doc/xml/manual/evolution.xml: Document addition of
217         libstdc++exp.a.
218         * doc/html/*: Regenerate.
220 2024-01-11  Marcus Haehnel  <marcus.haehnel@kernkonzept.com>
222         * libsupc++/eh_unex_handler.cc: Adjust definition type to
223         declaration.
225 2024-01-11  Michael Levine  <mlevine55@bloomberg.net>
227         * include/std/ranges (__glibcxx_want_ranges_iota): Remove
228         duplicate definition.
230 2024-01-11  François Dumont  <fdumont@gcc.gnu.org>
232         PR libstdc++/112477
233         * src/c++11/debug.cc
234         (_Safe_iterator_base::_M_attach): Reset _M_version to 0 if attaching to null
235         sequence.
236         (_Safe_iterator_base::_M_attach_single): Likewise.
237         (_Safe_local_iterator_base::_M_attach): Likewise.
238         (_Safe_local_iterator_base::_M_attach_single): Likewise.
239         * testsuite/23_containers/map/debug/112477.cc: New test case.
241 2024-01-11  Patrick Palka  <ppalka@redhat.com>
243         * include/bits/move.h (__like_t): Define in C++23 mode.
244         * include/std/ranges (views::__adaptor::Partial::operator()):
245         Implement using C++23 deducing this when available.
246         (views::__adaptor::_Pipe::operator()): Likewise.
247         * testsuite/std/ranges/adaptors/100577.cc: Adjust testcase to
248         accept new "no match for call" errors issued in C++23 mode.
249         * testsuite/std/ranges/adaptors/lazy_split_neg.cc: Likewise.
251 2024-01-11  Jonathan Wakely  <jwakely@redhat.com>
253         * python/libstdcxx/v6/printers.py (StdIntegralConstantPrinter):
254         Add printer for std::integral_constant.
255         * testsuite/libstdc++-prettyprinters/cxx11.cc: Test it.
257 2024-01-11  Jonathan Wakely  <jwakely@redhat.com>
259         PR libstdc++/113258
260         * libsupc++/new_opa.cc: Prefer to use posix_memalign if
261         available.
263 2024-01-11  Ken Matsui  <kmatsui@gcc.gnu.org>
265         * src/filesystem/ops-common.h (stat_type): Use using.
267 2024-01-11  Ken Matsui  <kmatsui@gcc.gnu.org>
269         PR libstdc++/113250
270         * src/c++17/fs_ops.cc (fs::equivalent): Use || instead of &&.
271         * src/filesystem/ops.cc (fs::equivalent): Likewise.
272         * testsuite/27_io/filesystem/operations/equivalent.cc: Handle
273         error codes.
274         * testsuite/experimental/filesystem/operations/equivalent.cc:
275         Likewise.
277 2024-01-11  Ken Matsui  <kmatsui@gcc.gnu.org>
279         * include/std/type_traits (is_compound): Do not use __not_.
280         (is_compound_v): Use is_fundamental_v instead.
282 2024-01-11  Patrick Palka  <ppalka@redhat.com>
284         * include/bits/utility.h (_Nth_type): Use
285         _GLIBCXX_USE_BUILTIN_TRAIT instead of __has_builtin.
287 2024-01-09  Jonathan Wakely  <jwakely@redhat.com>
289         * include/bits/unicode-data.h: Regenerate.
290         * include/bits/unicode.h (_Utf_iterator::operator++()): Fix off
291         by one error.
292         (__incb_property): Add missing check for values before the
293         first edge.
294         (__is_extended_pictographic): Invert return values to fix
295         copy&pasted logic.
296         (_Grapheme_cluster_view::_Iterator): Remove second iterator
297         member and find end of cluster lazily.
298         * testsuite/ext/unicode/grapheme_view.cc: New test.
299         * testsuite/ext/unicode/properties.cc: New test.
300         * testsuite/ext/unicode/view.cc: New test.
302 2024-01-09  Andreas Schwab  <schwab@linux-m68k.org>
304         * scripts/extract_symvers.in: Require final colon to only match
305         .dsynsym in the header of the dynamic symtab.
307 2024-01-09  Jonathan Wakely  <jwakely@redhat.com>
309         * include/bits/chrono_io.h (__formatter_chrono::_M_F): Simplify
310         handling of string returned from std::format.
311         (__formatter_chrono::_M_R_T): Likewise.
313 2024-01-08  Jonathan Wakely  <jwakely@redhat.com>
315         * include/bits/unicode.h (__null_sentinel): Remove.
316         * testsuite/17_intro/names.cc: Add __null_sentinel.
318 2024-01-08  Jonathan Wakely  <jwakely@redhat.com>
320         * include/std/format (__format::_Runtime_format_string): Define
321         new class template.
322         (basic_format_string): Add non-consteval constructor for runtime
323         format strings.
324         (runtime_format): Define new function for C++26.
325         * testsuite/std/format/runtime_format.cc: New test.
327 2024-01-08  Jonathan Wakely  <jwakely@redhat.com>
329         * include/bits/chrono_io.h (__formatter_chrono): Always use
330         lvalue arguments to make_format_args.
331         * include/std/format (make_format_args): Change parameter pack
332         from forwarding references to lvalue references. Remove use of
333         remove_reference_t which is now unnecessary.
334         (format_to, formatted_size): Remove incorrect forwarding of
335         arguments.
336         * include/std/ostream (print): Remove forwarding of arguments.
337         * include/std/print (print): Likewise.
338         * testsuite/20_util/duration/io.cc: Use lvalues as arguments to
339         make_format_args.
340         * testsuite/std/format/arguments/args.cc: Likewise.
341         * testsuite/std/format/arguments/lwg3810.cc: Likewise.
342         * testsuite/std/format/functions/format.cc: Likewise.
343         * testsuite/std/format/functions/vformat_to.cc: Likewise.
344         * testsuite/std/format/string.cc: Likewise.
345         * testsuite/std/time/day/io.cc: Likewise.
346         * testsuite/std/time/month/io.cc: Likewise.
347         * testsuite/std/time/weekday/io.cc: Likewise.
348         * testsuite/std/time/year/io.cc: Likewise.
349         * testsuite/std/time/year_month_day/io.cc: Likewise.
350         * testsuite/std/format/arguments/args_neg.cc: New test.
352 2024-01-08  Jonathan Wakely  <jwakely@redhat.com>
354         * include/Makefile.am: Add new headers.
355         * include/Makefile.in: Regenerate.
356         * include/bits/unicode.h: New file.
357         * include/bits/unicode-data.h: New file.
358         * include/std/format: Include <bits/unicode.h>.
359         (__literal_encoding_is_utf8): Move to <bits/unicode.h>.
360         (_Spec::_M_fill): Change type to char32_t.
361         (_Spec::_M_parse_fill_and_align): Read a Unicode scalar value
362         instead of a single character.
363         (__write_padded): Change __fill_char parameter to char32_t and
364         encode it into the output.
365         (__formatter_str::format): Use new __unicode::__field_width and
366         __unicode::__truncate functions.
367         * include/std/ostream: Adjust namespace qualification for
368         __literal_encoding_is_utf8.
369         * include/std/print: Likewise.
370         * src/c++23/print.cc: Add [[unlikely]] attribute to error path.
371         * testsuite/ext/unicode/view.cc: New test.
372         * testsuite/std/format/functions/format.cc: Add missing examples
373         from the standard demonstrating alignment with non-ASCII
374         characters. Add examples checking correct handling of extended
375         grapheme clusters.
377 2024-01-08  Jonathan Wakely  <jwakely@redhat.com>
379         * include/bits/version.def (format_uchar): Define.
380         * include/bits/version.h: Regenerate.
381         * include/std/format (formatter<C, C>::format): Check for
382         _Pres_c and call _M_format_character directly. Cast C to its
383         unsigned equivalent for formatting as an integer.
384         (formatter<char, wchar_t>::format): Likewise.
385         (basic_format_arg(T&)): Store char arguments as unsigned char
386         for formatting to a wide string.
387         * testsuite/std/format/functions/format.cc: Adjust test. Check
388         formatting of
390 2024-01-07  Jonathan Wakely  <jwakely@redhat.com>
392         PR libstdc++/112997
393         * libsupc++/unwind-cxx.h (__cxa_call_terminate): Change first
394         parameter to void*.
396 2024-01-07  Jonathan Wakely  <jwakely@redhat.com>
398         * testsuite/20_util/variant/87619.cc: Remove dg-timeout-factor.
400 2024-01-07  Jonathan Wakely  <jwakely@redhat.com>
402         * include/std/type_traits (is_trivially_destructible_v): Use
403         built-in directly when concepts are supported.
404         * testsuite/20_util/is_trivially_destructible/value_v.cc: New
405         test.
407 2024-01-06  Gwenole Beauchesne  <gb.devel@gmail.com>
409         * testsuite/tr1/8_c_compatibility/cinttypes/functions.cc: Use
410         nonnull arguments to strtoimax() and wcstoimax() functions.
412 2024-01-05  Jonathan Wakely  <jwakely@redhat.com>
414         * src/c++17/fs_path.cc (path::_List::reserve): Limit maximum
415         size and check for overflows in arithmetic.
416         (path::operator/=(const path&)): Remove redundant exponential
417         growth calculation.
419 2024-01-05  Martin Küttler  <martin.kuettler@kernkonzept.com>
421         * src/c++17/fs_path.cc (path::_List::reserve): Avoid
422         floating-point arithmetic.
424 2024-01-05  Jonathan Wakely  <jwakely@redhat.com>
426         PR libstdc++/113241
427         * include/std/type_traits (is_convertible_v): Guard use of
428         built-in with preprocessor check.
430 2024-01-05  Jonathan Wakely  <jwakely@redhat.com>
432         PR libstdc++/113200
433         * include/bits/char_traits.h (__gnu_cxx::char_traits::move): Use
434         __builtin_constant_p to check for unrelated pointers that cannot
435         be compared during constant evaluation.
436         * testsuite/21_strings/char_traits/requirements/113200.cc: New
437         test.
439 2024-01-05  Cassio Neri  <cassio.neri@gmail.com>
441         * include/std/chrono: Fix + and - for months and weekdays.
442         * testsuite/std/time/month/1.cc: Add constexpr tests against overflow.
443         * testsuite/std/time/month/2.cc: New test for extreme values.
444         * testsuite/std/time/weekday/1.cc: Add constexpr tests against overflow.
445         * testsuite/std/time/weekday/2.cc: New test for extreme values.
447 2024-01-05  Jonathan Wakely  <jwakely@redhat.com>
449         PR libstdc++/113099
450         * include/bits/locale_classes.tcc (__try_use_facet): Use
451         if-constexpr for C++11 and up.
453 2024-01-05  Ken Matsui  <kmatsui@gcc.gnu.org>
455         * include/std/type_traits: Use _GLIBCXX_USE_BUILTIN_TRAIT.
457 2024-01-04  Arsen Arsenović  <arsen@aarsen.me>
459         * include/std/generator (_Subyield_state::_M_jump_in): Fix typo
460         reported by Will Hawkins <hawkinsw@obs.cr>.
462 2024-01-04  Arsen Arsenović  <arsen@aarsen.me>
464         * include/std/generator (_Stateless_alloc): Rename typename _A
465         to _All.
467 2024-01-03  Patrick Palka  <ppalka@redhat.com>
469         PR testsuite/113175
470         * testsuite/std/ranges/iota/max_size_type.cc (test02): Reduce
471         'limit' to 100 from 1000 and adjust 'log2_limit' accordingly.
472         (test03): Likewise.
475 Copyright (C) 2024 Free Software Foundation, Inc.
477 Copying and distribution of this file, with or without modification,
478 are permitted in any medium without royalty provided the copyright
479 notice and this notice are preserved.