[committed] libstdc++: Check for multiple modifiers in chrono format string [PR110708]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. This should be backported to gcc-13 too, but it can wait until 13.3 (it's just an accepts-invalid and unlikely to affect anybody in practice). -- >8 -- The logic for handling modified chrono specs like %Ey was just restarting the loop after each modifier, an

[committed] libstdc++: Implement correct locale-specific chrono formatting [PR110719]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. I'll backport it to gcc-13 some time after the 13.2 release. -- >8 -- This fixes some TODOs in the C++20 format support, where the locale-specific output was incorrect or unimplemented. The approach taken here is to either use the formatting locale's std::t

[committed] libstdc++: Avoid warning in std::format

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- With -Wmaybe-uninitialized -Wsystem-headers there's a warning about creating a string_view from an uninitalized array. Initializing the first element of the array avoids the warning. libstdc++-v3/ChangeLog: * include/std/format (__write_pad

[committed] libstdc++: Fix locale-specific duration formatting [PR110719]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- The r14-2640-gf4bce119f617dc commit only removed fractional seconds for time points, but it needs to be done for durations and hh_mm_ss types too. libstdc++-v3/ChangeLog: PR libstdc++/110719 * include/bits/chrono_io.h (__formatter_c

[committed] libstdc++: Fix formatting of negative chrono::hh_mm_ss

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- When formatting with an empty chrono spec ("{}") two minus signs were being added to hh_mm_ss values. This is because the __is_neg flag was checked to add one explicitly, and then the ostream operator added another one. We should only check the __is

[PATCH] libstdc++: Fix preprocessor conditions for std::from_chars [PR109921]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
I'm testing this patch for gcc-13 as a better fix for PR109921, without the breakage that r14-1431-g7037e7b6e4ac41 caused on trunk. If testing goes well I'll push this before the 13.2 release candidate. -- >8 -- We use the from_chars_strtod function with __strtof128 to read a _Float128 value, bu

[committed] libstdc++: Check for std::ratio in arithmetic and comparisons [PR110593]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- The standard says that it should be ill-formed to use std::ratio_equal etc. with types which are not specializations of std::ratio. This implements that requirement. We don't need to add assertions to every one of the class templates, because many o

[committed] libstdc++: Do not define inaccurate from_chars for _Float128 [PR110077]

2023-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and sparc-solaris. Pushed to trunk. -- >8 -- I think r14-1431-g7037e7b6e4ac41 was wrong to try to define the _Float128 overload unconditionally. Not all targets need it, so defining the lossy fallback using long double is not useful (and caused an ABI change on Solaris x86).

[committed] libstdc++; Do not use strtold for hppa-hpux [PR110653]

2023-07-24 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. I hope this bug can be closed now, ut will have to wait for Dave Angling to post results. -- >8 -- When I switched std::stold to depend on HAVE_STRTOLD that enabled it for hppa-hpux which defines HAVE_BROKEN_STRTOLD. Add a check for that macro so that we don

[PATCH] libstdc++: Reuse double overload of __convert_to_v if possible

2023-07-24 Thread Jonathan Wakely via Gcc-patches
This seems like a worthwhile change. In theory we could make it even smaller by using a symbol alias, but I'm not sure that's supported on the targets where this will actually help. Any objections? -- >8 -- For targets where double and long double have the same representation we can reuse the sa

Re: [PATCH] libstdc++: Add missing constexpr specifier and function overloads

2023-07-24 Thread Jonathan Wakely via Gcc-patches
On 23/07/23 20:28 -0700, Deev Patel wrote: Hi, A couple of virtual functions in the libstdc++ format header are marked constexpr in the base class, but not in the derived class. This was causing build failures when trying to compile latest gcc libstd with clang 16 using c++20. Adding the constex

[committed] libstdc++: Add deprecated attribute to std::random_shuffle declarations

2023-07-26 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Probably worth backporting to 12 and 13. -- >8 -- We already have these attributes on the definitions in but they don't work due to PR c++/84542. Add the attributes to the declarations in as well, and add a test. libstdc++-v3/ChangeLog: * include

[committed] libstdc++: Avoid bogus overflow warnings in std::vector [PR110807]

2023-07-26 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Backport to gcc-13 will come after the 13.2 release. -- >8 -- GCC thinks the allocation can alter the object being copied if it's globally reachable, so doesn't realize that [x.begin(), x.end()) after the allocation is the same as x.size() before it. This ca

[committed] libstdc++: Require C++11 for 23_containers/vector/bool/110807.cc [PR110807]

2023-07-26 Thread Jonathan Wakely via Gcc-patches
Pushed to trunk. -- >8 -- This new test uses uniform initialization syntax, so requires C++11 or later. libstdc++-v3/ChangeLog: PR libstdc++/110807 * testsuite/23_containers/vector/bool/110807.cc: Require c++11. --- libstdc++-v3/testsuite/23_containers/vector/bool/110807.cc | 2

[committed] libstdc++: Fix std::format alternate form for floating-point [PR108046]

2023-07-27 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. Backport to gcc-13 to follow. -- >8 -- A decimal point was being added to the end of the string for {:#.0} because the __expc character was not being set, for the _Pres_none presentation type, so __s.find(__expc) didn't the 'e' in "1e+01" and so we created "1

[committed] libstdc++: Improve exceptions thrown from fs::temp_directory_path

2022-06-30 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux and x86_64-mingw, pushed to trunk. -- >8 -- Currently the throwing overload of fs::temp_directory_path() will discard the path that was obtained from the environment. When it fails because the path doesn't resolve to a directory you get an unhelpful error like: filesystem e

[PATCH] c-family: Add names to diagnostics for known headers

2022-06-30 Thread Jonathan Wakely via Gcc-patches
I recently changed to no longer include an unnecessary header, which meant it no longer includes , which means it no longer includes . This resulted in some build failures: https://issues.apache.org/jira/browse/LUCENE-10630 https://github.com/openSUSE/libzypp/pull/405 And that revealed that we do

[committed] libstdc++: Fix comment typos

2022-06-30 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/bits/utility.h: Fix comment typos. --- libstdc++-v3/include/bits/utility.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libstdc++-v3/include/bits/utility.h b/libstdc++-v3/incl

[PATCH] c++: Refer to internal linkage for -Wsubobject-linkage [PR86491]

2022-06-30 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, OK for trunk? -- >8 -- Since C++11 relaxed the requirement for template arguments to have external linkage, it's possible to get -Wsubobject-linkage warnings without using any anonymous namespaces. This confuses users when they get diagnostics that refer to an anonymous

[committed] libstdc++: Add nodiscard attribute to filesystem operations

2022-07-01 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- Some of these are not truly "pure" because they access the file system, e.g. exists and file_size, but they do not modify anything and are only useful for the return value. If you really want to use one of those functions just to check whether an er

[committed] libstdc++: Add missing prerequisite to generated header [PR106162]

2022-07-01 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. This should be backported too. -- >8 -- The ${host_builddir}/largefile-config.h header can't be written until its parent directory has been created, so it needs to have the creation of that directory as a prerequisite. libstdc++-v3/ChangeLog: P

Re: [PATCH] c-family: Add names to diagnostics for known headers

2022-07-04 Thread Jonathan Wakely via Gcc-patches
On Thu, 30 Jun 2022 at 16:15, Marek Polacek wrote: > > On Thu, Jun 30, 2022 at 04:11:42PM +0100, Jonathan Wakely via Gcc-patches > wrote: > > I recently changed to no longer include an unnecessary header, > > which meant it no longer includes , which means it no longe

Re: [PATCH] libstdc++: testsuite: avoid predictable mkstemp

2022-07-05 Thread Jonathan Wakely via Gcc-patches
On Tue, 5 Jul 2022 at 10:10, Alexandre Oliva via Libstdc++ wrote: > > On Jun 27, 2022, Alexandre Oliva wrote: > > > On Jun 23, 2022, Jonathan Wakely wrote: > >> The attached makes this a bit more efficient, and makes more of the > >> code common to the mkstemp and non-mkstmp branches. I'll wait

[committed][wwwdocs] Add notes about and header dependencies

2022-07-05 Thread Jonathan Wakely via Gcc-patches
I backported a change to the header which meant it no longer includes , which broke some (incorrect) packages. This updates the GCC 12 docs to mention it. Pushed to wwwdocs. -- >8 -- Also fix missing closing tag for . --- htdocs/gcc-12/porting_to.html | 8 1 file changed, 8 insertions

Re: [PATCH] libstdc++: testsuite: avoid predictable mkstemp

2022-07-05 Thread Jonathan Wakely via Gcc-patches
On Tue, 5 Jul 2022 at 18:46, Alexandre Oliva wrote: > > On Jul 5, 2022, Jonathan Wakely wrote: > > > The cast itself is fine, but I'd like a comment like "N.B. pid_t is a > > pointer on vxworks" so I don't "simplify" it again. > > > libstdc++: testsuite: why cast getpid result > > Add a comment

[PATCH] testsuite: Fix incorrect -mfloat128-type option

2022-07-06 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64-linux, OK for trunk? -- >8 -- This test currently fails with an error about -mfloat128-type being an invalid option, which is not what it's supposed to be testing: XFAIL: gcc.target/powerpc/ppc-fortran/pr80108-1.f90 -O (test for excess errors) Excess errors: xgcc: error: unr

Re: libstdc++: Minor codegen improvement for atomic wait spinloop

2022-07-06 Thread Jonathan Wakely via Gcc-patches
On Wed, 6 Jul 2022 at 02:05, Thomas Rodgers via Libstdc++ wrote: > > This patch merges the spin loops in the atomic wait implementation which is > a > minor codegen improvement. > > libstdc++-v3/ChangeLog: > * include/bits/atomic_wait.h (__atomic_spin): Merge spin loops. OK, thanks.

Re: libstdc++: Minor codegen improvement for atomic wait spinloop

2022-07-07 Thread Jonathan Wakely via Gcc-patches
On Wed, 6 Jul 2022 at 22:42, Thomas Rodgers wrote: > > Ok for trunk? backport? Yes, for all branches that have the atomic wait code. > > On Wed, Jul 6, 2022 at 1:56 PM Jonathan Wakely wrote: >> >> On Wed, 6 Jul 2022 at 02:05, Thomas Rodgers via Libstdc++ >> wrote: >> > >> > This patch merges

[committed] libstdc++: Remove workaround in __gnu_cxx::char_traits::move [PR89074]

2022-07-07 Thread Jonathan Wakely via Gcc-patches
Tested aarch64-linux, pushed to trunk. -- >8 -- The front-end bug that prevented this constexpr loop from working has been fixed since GCC 12.1 so we can remove the workaround. libstdc++-v3/ChangeLog: PR c++/89074 * include/bits/char_traits.h (__gnu_cxx::char_traits::move):

[PATCH] libstdc++: Prefer const T to std::add_const_t

2022-07-07 Thread Jonathan Wakely via Gcc-patches
Does anybody see a problem with this change? The point is to avoid unnecessary class template instantiations. Tested aarch64-linux. -- >8 -- For any typedef-name or template parameter, T, add_const_t is equivalent to T const, so we can avoid instantiating the std::add_const class template and ju

[PATCH] c++: Define built-in for std::tuple_element [PR100157]

2022-07-07 Thread Jonathan Wakely via Gcc-patches
This adds a new built-in to replace the recursive class template instantiations done by traits such as std::tuple_element and std::variant_alternative. The purpose is to select the Nth type from a list of types, e.g. __builtin_type_pack_element(1, char, int, float) is int. For a pathological examp

Re: [PATCH] c++: Define built-in for std::tuple_element [PR100157]

2022-07-07 Thread Jonathan Wakely via Gcc-patches
On Thu, 7 Jul 2022 at 20:29, Jason Merrill wrote: > > On 7/7/22 13:14, Jonathan Wakely wrote: > > This adds a new built-in to replace the recursive class template > > instantiations done by traits such as std::tuple_element and > > std::variant_alternative. The purpose is to select the Nth type fr

Re: [committed] libstdc++: Remove obsolete comment in

2022-07-09 Thread Jonathan Wakely via Gcc-patches
On Sat, 9 Jul 2022 at 13:26, François Dumont via Libstdc++ wrote: > > libstdc++: Remove obsolete comment in header > > The comment is obsolete because char_traits.h do not include > stl_algobase.h > anymore and stl_algobase.h is included directly from a few > lines > below. N

Re: [PATCH] c++: Add __reference_con{struc, ver}ts_from_temporary [PR104477]

2022-07-11 Thread Jonathan Wakely via Gcc-patches
On Fri, 8 Jul 2022 at 18:41, Marek Polacek wrote: > The patch also adds the relevant class and variable templates to > . + template +struct reference_constructs_from_temp orary +: public __bool_constant<__reference_constructs_from_temporary(_Tp, _Up)> This can use bool_constant, as tha

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-11 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022, 01:25 David Malcolm, wrote: > On Fri, 2022-07-08 at 22:16 +0100, Jonathan Wakely wrote: > > On Fri, 8 Jul 2022 at 21:47, David Malcolm via Gcc > > wrote: > > > > > > std::unique_ptr is C++11, and I'd like to use it in the > > > gcc/analyzer > > > subdirectory, at least. The

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 07:48, Jonathan Wakely wrote: > You also need for the enable_if and is_array traits. With > libstdc++ that gets included by but that's guaranteed for other > library implementations. Sorry, I was replying from my phone and missed a word. That's **not** guaranteed for oth

Re: [PATCH] libstdc++: Prefer const T to std::add_const_t

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Thu, 7 Jul 2022 at 17:55, Jonathan Wakely via Libstdc++ wrote: > > Does anybody see a problem with this change? The point is to avoid > unnecessary class template instantiations. > > Tested aarch64-linux. Pushed to trunk now. > > -- >8 -- > > For any typedef-name or template parameter, T, add

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 14:24, Pedro Alves wrote: > > On 2022-07-12 1:25 a.m., David Malcolm via Gcc-patches wrote: > > > I tried adding it to gcc/system.h, but anything that uses it needs to > > have std::unique_ptr declared, which meant forcibly including > > from gcc/system.h > > Did you conside

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 15:06, Pedro Alves wrote: > > On 2022-07-12 2:45 p.m., Jonathan Wakely wrote: > > On Tue, 12 Jul 2022 at 14:24, Pedro Alves wrote: > >> > >> On 2022-07-12 1:25 a.m., David Malcolm via Gcc-patches wrote: > >> > >>> I tried adding it to gcc/system.h, but anything that uses it

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022, 17:40 Pedro Alves, wrote: > On 2022-07-12 4:14 p.m., Jonathan Wakely wrote: > > >> So once GCC requires C++14, why would you want to preserve > >> once-backported symbols in a namespace other than std, when you no > longer have a reason to? > >> It will just be another unnec

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022, 19:36 Pedro Alves, wrote: > On 2022-07-12 7:22 p.m., Jonathan Wakely wrote: > > > > > > On Tue, 12 Jul 2022, 17:40 Pedro Alves, pe...@palves.net>> wrote: > > > > On 2022-07-12 4:14 p.m., Jonathan Wakely wrote: > > > > >> So once GCC requires C++14, why would you wan

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 19:41, Pedro Alves wrote: > > On 2022-07-12 7:36 p.m., Pedro Alves wrote: > > On 2022-07-12 7:22 p.m., Jonathan Wakely wrote: > >> > >> > >> On Tue, 12 Jul 2022, 17:40 Pedro Alves, >> > wrote: > >> > >> On 2022-07-12 4:14 p.m., Jonathan Wakely w

Re: [PATCH 1/2] Add gcc/make-unique.h

2022-07-12 Thread Jonathan Wakely via Gcc-patches
On Tue, 12 Jul 2022 at 19:58, Jonathan Wakely wrote: > [OFFLIST] Oops, sorry, reply-all fail. I meant to spare everybody any further musing on this topic. Really leaving the thread now!

[committed] libstdc++: Check for EOF if extraction avoids buffer overflow [PR106248]

2022-07-12 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. Backports to gcc-12 and gcc-11 to follow. -- >8 -- In r11-2581-g17abcc77341584 (for LWG 2499) I added overflow checks to the pre-C++20 operator>>(istream&, char*) overload. Those checks can cause extraction to stop after filling the buffer, where previously

[PATCH] jit: Make recording::memento non-copyable

2022-07-14 Thread Jonathan Wakely via Gcc-patches
These polymoprhic types don't appear to be copied anywhere. Rather than trying to reason about what it means to copy a polymoprhic base without copying the derived part, disable copies. This also avoids a potential double-free if a recorindg::string object does somehow get copied (it owns a pointer

[PATCH] libcpp: Improve encapsulation of label_text

2022-07-14 Thread Jonathan Wakely via Gcc-patches
I'm not sure if label_text::get () is the best name for the new accessor. Other options include buffer () and c_str () but I don't see a compelling reason to prefer either of those. As a follow-up patch we could change label_text::m_buffer (and pod_label_text::m_buffer) to be const char*, since th

Re: [PATCH] libcpp: Improve encapsulation of label_text

2022-07-15 Thread Jonathan Wakely via Gcc-patches
On Thu, 14 Jul 2022 at 22:31, David Malcolm wrote: > > On Thu, 2022-07-14 at 22:10 +0100, Jonathan Wakely wrote: > > Thanks for the patch. > > > I'm not sure if label_text::get () is the best name for the new > > accessor. Other options include buffer () and c_str () but I don't > > see a > > compe

Re: [PATCH] Simplify branching in algos

2022-07-18 Thread Jonathan Wakely via Gcc-patches
On Mon, 18 Jul 2022 at 11:25, François Dumont wrote: > > Hi > > I just noticed that I still had this nice enhancement in my local > branches. > > Ok to commit ? OK, thanks.

Re: Re: [PATCH] libstdc++: Make __from_chars_alnum_to_val conversion explicit

2022-07-19 Thread Jonathan Wakely via Gcc-patches
On Mon, 18 Jul 2022 at 11:11, Marco Falke via Libstdc++ wrote: > > (in reply to https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598412.html, > adding libstdc++ to CC, with the same patch attached again) > > To clarify, this is not a fix for a user-facing issue of gcc or a fix > for UB. It is j

Re: [PATCH] c++: Add __reference_con{struc, ver}ts_from_temporary [PR104477]

2022-07-19 Thread Jonathan Wakely via Gcc-patches
On Sun, 17 Jul 2022 at 22:13, Stephan Bergmann via Libstdc++ wrote: > > On 7/15/22 22:25, Marek Polacek via Gcc-patches wrote: > > Yeah, I guess so. But I've already pushed the patch. > > This commit obviously breaks using libstdc++ with Clang (in -std=c++2b > mode), which doesn't implement those

Re: Re: [PATCH] libstdc++: Make __from_chars_alnum_to_val conversion explicit

2022-07-19 Thread Jonathan Wakely via Gcc-patches
On Tue, 19 Jul 2022 at 11:13, Marco Falke wrote: > > Thanks Jonathan. Either name is perfectly fine. OK, thanks. > > To clarify, this will be pushed to master and also backported to the > 12-branch? Yes, that's right. It will go to trunk (aka master) today and then backported to the gcc-12 bra

Re: [PATCH] Complete __gnu_debug::basic_string Standard conformity

2022-07-19 Thread Jonathan Wakely via Gcc-patches
On Sun, 10 Jul 2022 at 14:57, François Dumont via Libstdc++ wrote: > > Here is a first patch to complete __gnu_debug::basic_string Standard > conformity. > > I prefer to submit this before checking for more missing stuff to check > that my proposal of having a testsuite_string.h header is ok. I t

Re: [PATCH] c++: Add __reference_con{struc, ver}ts_from_temporary [PR104477]

2022-07-19 Thread Jonathan Wakely via Gcc-patches
On Tue, 19 Jul 2022 at 11:08, Jonathan Wakely wrote: > > On Sun, 17 Jul 2022 at 22:13, Stephan Bergmann via Libstdc++ > wrote: > > > > On 7/15/22 22:25, Marek Polacek via Gcc-patches wrote: > > > Yeah, I guess so. But I've already pushed the patch. > > > > This commit obviously breaks using libst

[PATCH] c++: Enable __has_builtin for new reference binding built-ins

2022-07-19 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, OK for trunk? -- >8 -- The new built-ins need to be detectable using __has_builtin, and the library should use that to check for them. This fixes an error with Clang when C++23 is enabled. gcc/cp/ChangeLog: * cp-objcp-common.cc (names_builtin_p): Return true for

Re: [PATCH] c++: Add __reference_con{struc, ver}ts_from_temporary [PR104477]

2022-07-19 Thread Jonathan Wakely via Gcc-patches
On Tue, 19 Jul 2022 at 12:10, Jonathan Wakely wrote: > > On Tue, 19 Jul 2022 at 11:08, Jonathan Wakely wrote: > > > > On Sun, 17 Jul 2022 at 22:13, Stephan Bergmann via Libstdc++ > > wrote: > > > > > > On 7/15/22 22:25, Marek Polacek via Gcc-patches wrote: > > > > Yeah, I guess so. But I've alrea

[committed 1/3] libstdc++: Fix minor bugs in std::common_iterator

2022-07-20 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- The noexcept-specifier for some std::common_iterator constructors was incorrectly using an rvalue as the first argument of std::is_nothrow_assignable_v. This gave the wrong answer for some types, e.g. std::common_iterator, because an rvalue of s

[committed 3/3] libstdc++: Fix std::common_iterator triviality [PR100823]

2022-07-20 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- This fixes the remaining problem reported in the PR, that the special members should be trivial. This can be done by constraining the non-trivial versions and adding defaulted overloads that will be used when the union members are trivial. Mak

[committed 2/3] libstdc++: Fix std::common_iterator assignment [PR100823]

2022-07-20 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- This fixes the following conformance problems reported in the PR: - Move constructor and move assignment should be defined. - Copy assignment from a valueless object should be allowed. Assignment is completely rewritten by this patch, as the p

Re: [PATCH] Allow space in git commit-mklog args

2022-07-22 Thread Jonathan Wakely via Gcc-patches
On Fri, 22 Jul 2022 at 10:38, Martin Liška wrote: > > Hi. > > Motivation example: > $ git commit-mklog -a -b 'PR other/106370,PR other/12345' > > Preserving a space from git gcc-mklog hook to contrib/mklog.py seems > pretty challenging. Thus I recommend preserving extra mklog args via > env where i

Re: [PATCH] c++: Refer to internal linkage for -Wsubobject-linkage [PR86491]

2022-07-22 Thread Jonathan Wakely via Gcc-patches
ping https://gcc.gnu.org/pipermail/gcc-patches/2022-June/597560.html On Thu, 30 Jun 2022 at 17:53, Jonathan Wakely wrote: > > Tested powerpc64le-linux, OK for trunk? > > -- >8 -- > > Since C++11 relaxed the requirement for template arguments to have > external linkage, it's possible to get -Wsubo

Re: [PATCH] libstdc++: Fix backward compatibility of P2325R3 backport [PR106320]

2022-07-22 Thread Jonathan Wakely via Gcc-patches
On Fri, 22 Jul 2022 at 16:52, Patrick Palka via Libstdc++ wrote: > > The 11 and 10 partial backports of P2325R3, r11-9555-g92d6121eec and > r10-10808-g22b86cdc4d7fdd, unnecessarily preserved some changes from the > paper that made certain views no longer default constructible, changes > which

Re: [PATCH] contrib: use sphinx-build from a venv

2022-07-26 Thread Jonathan Wakely via Gcc-patches
On Tue, 26 Jul 2022 at 12:45, Frank Ch. Eigler wrote: > > Hi - > > > CCing overseers and Frank. > > Can you please help me with that? > > > > Can please a maintainer install the package from pip? > > > Something like: > > > virtualenv /home/gcc/venv && /home/gcc/venv/bin/pip install Sphinx > > > o

Re: [PATCH] contrib: use sphinx-build from a venv

2022-07-26 Thread Jonathan Wakely via Gcc-patches
On Tue, 26 Jul 2022 at 12:56, Frank Ch. Eigler wrote: > > Hi - > > > > The gccadmin team can do this kind of thing without overseer/root > > > privileges, or indeed so can any local shell-privileged user. > > > > Yeah, I said I didn't want to install it that way without overseer > > approval, as pi

[committed] libstdc++: Tweak common_iterator::operator-> return type [PR104443]

2022-07-29 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- This adjusts the return type to match the resolution of LWG 3672. There is no functional difference, because decltype(auto) always deduced a value anyway, but this makes it simpler and consistent with the working draft. libstdc++-v3/ChangeLog:

Re: [committed] wwwdocs: cxx-status: Move www.open-std.org to https

2022-07-31 Thread Jonathan Wakely via Gcc-patches
" On Sat, 30 Jul 2022 at 22:28, Gerald Pfeifer wrote: > > This is a trivial change which fixes several dozen links. > > Marek, Jason, Jonathan - I noticed that (in other places) we have both > links to www.open-std.org and open-std.org, both of which seem to work. > > What is the preferred spelli

Re: [PATCH][pushed] gcc-changelog: do not run extra deduction

2022-08-02 Thread Jonathan Wakely via Gcc-patches
On Tue, 2 Aug 2022 at 09:51, Martin Liška wrote: > > Do not deduce changelog for root ChangeLog (''). > > Small cleanup, pushed. > > @Jonathan: Please update the server hook. Done. It looks like several recent changes to the hook had not been committed to the gcc-hooks repo, so I've done that now.

[committed] libstdc++: Avoid try-catch and O(N) size in std::list::merge for old ABI

2022-08-03 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to gcc-10 branch. -- >8 -- The current std::list::merge code calls size() before starting to merge any elements, so that the _M_size members can be updated after the merge finishes. The work is done in a try-block so that the sizes can still be updated in an exception

Re: tuple pretty printer

2022-08-04 Thread Jonathan Wakely via Gcc-patches
CC gcc-patches On Wed, 27 Jul 2022 at 17:40, Ulrich Drepper via Libstdc++ wrote: > > The current tuple pretty printer shows for this variable > > std::tuple a{1,2,3}; > > the following output: > > (gdb) p a > $1 = std::tuple containing = {[1] = 1, [2] = 2, [3] = 3} > > I find this quite irritatin

[committed] libstdc++: Unblock atomic wait on non-futex platforms [PR106183]

2022-08-04 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, powerpc64le-linux and sparc-solaris2.11, pushed to trunk. We want this on the gcc-12 and gcc-11 branches too. -- >8 -- When using a mutex and condition variable, the notifying thread needs to increment _M_ver while holding the mutex lock, and the waiting thread needs to re-c

[committed] libstdc++: Update value of __cpp_lib_ios_noreplace macro

2022-08-04 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- My P2467R1 proposal was accepted for C++23 so there's an official value for this macro now. libstdc++-v3/ChangeLog: * include/bits/ios_base.h (__cpp_lib_ios_noreplace): Update value to 202207L. * include/std/version (__

[committed] libstdc++: Rename data members of std::unexpected and std::bad_expected_access

2022-08-04 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- The P2549R1 paper was accepted for C++23. I already implemented it for our , but I didn't rename the private daata members, only the public member functions. This renames the data members for consistency with the working draft. libstdc++-v3/Cha

[committed] libstdc++: Add comparisons to std::default_sentinel_t (LWG 3719)

2022-08-04 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- This library defect was recently approved for C++23. libstdc++-v3/ChangeLog: * include/bits/fs_dir.h (directory_iterator): Add comparison with std::default_sentinel_t. Remove redundant operator!= for C++20. * (r

[committed] libstdc++: Make std::string_view(Range&&) constructor explicit

2022-08-04 Thread Jonathan Wakely via Gcc-patches
Tested powerpc64le-linux, pushed to trunk. -- >8 -- The P2499R0 paper was recently approved for C++23. libstdc++-v3/ChangeLog: * include/std/string_view (basic_string_view(Range&&)): Add explicit as per P2499R0. * testsuite/21_strings/basic_string_view/cons/char/range_c+

[committed] libstdc++: Implement from LFTSv3

2022-08-05 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/Makefile.am: Add new header. * include/Makefile.in: Regenerate. * include/experimental/scope: New file. * testsuite/experimental/scopeguard/uniqueres.cc: New test. * testsuite

[committed] libstdc++: Add feature test macro for

2022-08-05 Thread Jonathan Wakely via Gcc-patches
I forgot to add this macro to the new header. Tested x86_64-linux, pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/experimental/scope (__cpp_lib_experimental_scope): Define. * testsuite/experimental/scopeguard/uniqueres.cc: Check macro. --- libstdc++-v3/incl

Re: [PATCH][_GLIBCXX_DEBUG] Refine singular iterator state

2022-08-08 Thread Jonathan Wakely via Gcc-patches
On Mon, 8 Aug 2022 at 06:07, François Dumont via Libstdc++ wrote: > > Another version of this patch with just a new test case showing what > wrong code was unnoticed previously by the _GLIBCXX_DEBUG mode. > > On 04/08/22 22:56, François Dumont wrote: > > This an old patch I had prepared a long tim

Re: [PATCH] Add _GLIBCXX_DEBUG backtrace generation

2022-08-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 13 Jul 2022 at 18:28, François Dumont via Libstdc++ wrote: > > libstdc++: [_GLIBCXX_DEBUG] Add backtrace generation on demand > >Add _GLIBCXX_DEBUG_BACKTRACE macro to activate backtrace generation > on _GLIBCXX_DEBUG assertions. Prerequisite is to have configure the lib > with: > >

Re: [PATCH][_GLIBCXX_DEBUG] Refine singular iterator state

2022-08-08 Thread Jonathan Wakely via Gcc-patches
On Mon, 8 Aug 2022, 19:15 François Dumont via Libstdc++, < libstd...@gcc.gnu.org> wrote: > On 08/08/22 15:19, Jonathan Wakely wrote: > > On Mon, 8 Aug 2022 at 06:07, François Dumont via Libstdc++ > > wrote: > >> Another version of this patch with just a new test case showing what > >> wrong code

Re: [committed] Fix several preprocessor directives

2023-08-07 Thread Jonathan Wakely via Gcc-patches
On Sun, 30 Jul 2023 at 14:55, François Dumont via Libstdc++ < libstd...@gcc.gnu.org> wrote: > Committed as obvious. > > libstdc++: Fix several preprocessor directives > > A wrong usage of #define in place of a #error seems to have been > replicated > at different places in source fi

[committed] libstdc++: Fix past-the-end increment in std::format [PR110862]

2023-08-07 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. gcc-13 backport to follow. -- >8 -- At the end of a replacement field we should check that the closing brace is actually present before incrementing past it. libstdc++-v3/ChangeLog: PR libstdc++/110862 * include/std/format (_Scanner::_M_on_r

[committed] i386: Fix grammar typo in diagnostic

2023-08-07 Thread Jonathan Wakely via Gcc-patches
Committed as obvious. Less obvious (to me) is whether it's correct to say "GCC V13" here. I don't think we refer to a version that way anywhere else, do we? Would "since GCC 13.1.0" be better? -- >8 -- gcc/ChangeLog: * config/i386/i386.cc (ix86_invalid_conversion): Fix grammar. --- gc

[committed] libstdc++: Fix incorrect use of abs and log10 in std::format [PR110860]

2023-08-07 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. gcc-13 backport to follow. -- >8 -- The std::formatter implementation for floating-point types uses __builtin_abs and __builtin_log10 to avoid including all of , but those functions are not generic. The result of abs(2e304) is -INT_MIN which is undefined, and

[committed] libstdc++: Constrain __format::_Iter_sink for contiguous iterators [PR110917]

2023-08-07 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. gcc-13 backport to follow. -- >8 -- We can't write to a span<_CharT> if the contiguous iterator has a value type that isn't _CharT. libstdc++-v3/ChangeLog: PR libstdc++/110917 * include/std/format (__format::_Iter_sink): Constrain pa

Re: [PATCH v3 1/3] c++, libstdc++: Implement __is_arithmetic built-in trait

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Sat, 22 Jul 2023 at 14:51, François Dumont via Libstdc++ < libstd...@gcc.gnu.org> wrote: > > On 18/07/2023 08:27, Ken Matsui via Libstdc++ wrote: > > This patch implements built-in trait for std::is_arithmetic. > > > > gcc/cp/ChangeLog: > > > > * cp-trait.def: Define __is_arithmetic. > >

Re: [PATCH] libstdc++: Use __bool_constant entirely

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Sat, 15 Jul 2023 at 04:02, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > This patch uses __bool_constant entirely instead of integral_constant > in the type_traits header, specifically for true_type, false_type, > and bool_constant. > > libstdc++-v3/ChangeLog: > > * include

Re: [PATCH v2 2/3] libstdc++: Optimize is_arithmetic performance by __is_arithmetic built-in

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Sat, 15 Jul 2023 at 05:57, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > This patch optimizes the performance of the is_arithmetic trait by > dispatching to the new __is_arithmetic built-in trait. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_arithmetic): Us

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Tue, 18 Jul 2023 at 07:28, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > I will eventually work on disjunction to somehow optimize, but in the > meantime, this might be a better implementation. Of course, my > benchmark could be wrong. > You should use __or_ internally in libstdc+

Re: [PATCH v2 3/3] libstdc++: Optimize is_fundamental performance by __is_arithmetic built-in

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Tue, 18 Jul 2023 at 07:25, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > Hi, > > I took a benchmark for this. > > > https://github.com/ken-matsui/gcc-benches/blob/main/is_fundamental-disjunction.md#mon-jul-17-105937-pm-pdt-2023 > > template > struct is_fundamental > : public std::b

Re: [PATCH] libstdc++: Define _GLIBCXX_HAS_BUILTIN_TRAIT

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 19 Jul 2023 at 19:48, Patrick Palka via Libstdc++ < libstd...@gcc.gnu.org> wrote: > On Tue, 18 Jul 2023, Ken Matsui via Libstdc++ wrote: > > > This patch defines _GLIBCXX_HAS_BUILTIN_TRAIT, which will be used as a > > flag to toggle built-in traits in the type_traits header. Through this >

Re: [PATCH v2] libstdc++: Define _GLIBCXX_HAS_BUILTIN_TRAIT

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Wed, 19 Jul 2023 at 20:33, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > This patch defines _GLIBCXX_HAS_BUILTIN_TRAIT macro, which will be used > as a flag to toggle the use of built-in traits in the type_traits header > through _GLIBCXX_NO_BUILTIN_TRAITS macro, without needing to

Re: [PATCH v2 2/3] libstdc++: Optimize is_arithmetic performance by __is_arithmetic built-in

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Tue, 8 Aug 2023 at 21:09, Jonathan Wakely wrote: > > > On Sat, 15 Jul 2023 at 05:57, Ken Matsui via Libstdc++ < > libstd...@gcc.gnu.org> wrote: > >> This patch optimizes the performance of the is_arithmetic trait by >> dispatching to the new __is_arithmetic built-in trait. >> >> libstdc++-v3/C

Re: [PATCH v4 4/4] libstdc++: Optimize is_compound trait performance

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Tue, 18 Jul 2023 at 08:44, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > This patch optimizes the performance of the is_compound trait by > dispatching to the new __is_arithmetic built-in trait. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_compound): Use __

Re: [PATCH v10 4/5] libstdc++: Use new built-in trait __is_function for std::is_function

2023-08-08 Thread Jonathan Wakely via Gcc-patches
On Thu, 13 Jul 2023 at 03:41, Ken Matsui via Libstdc++ < libstd...@gcc.gnu.org> wrote: > This patch gets std::is_function to dispatch to new built-in trait > __is_function. > > libstdc++-v3/ChangeLog: > > * include/std/type_traits (is_function): Use __is_function built-in > trait.

[committed] libstdc++: Minor fixes for some warnings in

2023-08-09 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/std/format: Fix some warnings. (__format::__write(Ctx&, basic_string_view)): Remove unused function template. --- libstdc++-v3/include/std/format | 28 +--- 1 file ch

[committed] libstdc++: Fix some -Wunused-parameter warnings

2023-08-09 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/bits/alloc_traits.h (allocate): Add [[maybe_unused]] attribute. * include/bits/regex_executor.tcc: Remove name of unused parameter. * include/bits/shared_ptr_atomic.h (atomic_

[committed] libstdc++: Explicitly default some copy ctors and assignments

2023-08-09 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- The standard says that the implicit copy assignment operator is deprecated for classes that have a user-provided copy constructor, and vice versa. libstdc++-v3/ChangeLog: * include/bits/new_allocator.h (__new_allocator): Define copy

[committed] libstdc++: Fix some -Wmismatched-tags warnings

2023-08-09 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/bits/shared_ptr_atomic.h (atomic): Change class-head to struct. * include/bits/stl_tree.h (_Rb_tree_merge_helper): Change class-head to struct in friend declaration. * include

[committed] libstdc++: Fix a -Wsign-compare warning in std::list

2023-08-09 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- libstdc++-v3/ChangeLog: * include/bits/list.tcc (list::sort(Cmp)): Fix -Wsign-compare warning for loop condition. --- libstdc++-v3/include/bits/list.tcc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v

[committed] libstdc++: Fix constexpr functions to conform to older standards

2023-08-09 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- Some constexpr functions were inadvertently relying on relaxed constexpr rules from later standards. libstdc++-v3/ChangeLog: * include/bits/chrono.h (duration_cast): Do not use braces around statements for C++11 constexpr rules.

[committed] libstdc++: Suppress clang -Wc99-extensions warnings in

2023-08-09 Thread Jonathan Wakely via Gcc-patches
Tested x86_64-linux. Pushed to trunk. -- >8 -- This prevents Clang from warning about the use of the non-standard __complex__ keyword. libstdc++-v3/ChangeLog: * include/std/complex: Add diagnostic pragma for clang. --- libstdc++-v3/include/std/complex | 9 + 1 file changed, 9 i

<    1   2   3   4   5   6   7   8   9   10   >