Re: [PATCH] c++, v2: Change mangling of Intel/Motorola extended long double literals

2025-09-20 Thread Jason Merrill
On 9/10/25 9:29 AM, Jakub Jelinek wrote: On Mon, Sep 08, 2025 at 07:44:39PM +0200, Jakub Jelinek wrote: On Mon, Sep 08, 2025 at 06:14:06PM +0200, Jakub Jelinek wrote: Yet another option would be keep doing what we were doing unless GET_MODE_PRECISION is 80, in which case deal with the 2 variant

Re: [PATCH] c++: Fix lambdas with variadic parameters and static specifier [PR119048]

2025-09-20 Thread Jason Merrill
On 9/20/25 2:25 PM, Eczbek wrote: Or shorten to FUNCTION_FIRST_USER_PARMTYPE (fn_[ab]). Jason Thanks! -- >8 -- From d4613869df103ba461ca268c8a803ad529f479ba Mon Sep 17 00:00:00 2001 From: Eczbek Date: Sat, 20 Sep 2025 08:58:00 -0400 Subject: [PATCH] c++: Fix lambdas with variadic parameter

Re: [PATCH] c++: find_template_parameters and NTTPs [PR121981]

2025-09-20 Thread Jason Merrill
On 9/18/25 9:16 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk and eventually backports? OK. -- >8 -- Here the normal form of the two immediately-declared D<, V> constraints is the same, so we rightfully share the normal form between t

Re: [PATCH] c++, contracts: Abstract interfaces to constexpr [NFC].

2025-09-20 Thread Jason Merrill
On 9/17/25 5:35 PM, Iain Sandoe wrote: Another small preparation patch for C++26 upstreaming. Tested on x86_64-darwin, powerpc64le-linux, OK for trunk? OK. --- 8< --- We want to move to having different representations of the contract semantic for C++26, since that wants values outside the r

analyzer trouble with P2795R5 - Erroneous behavior for uninitialized reads [PR114457]

2025-09-19 Thread Jason Merrill
(splitting thread to focus on analyzer issues below) On 9/18/25 6:54 PM, Jason Merrill wrote: On 9/17/25 6:08 PM, Jakub Jelinek wrote: Hi! Here is my current version of the C++26 P2795R5 support. This now includes redirecting of forward/backward gotos which cross vacuous initializations for

Re: [PATCH] c++: Fix lambdas with variadic parameters and static specifier [PR119048]

2025-09-19 Thread Jason Merrill
On 9/18/25 9:57 PM, Patrick Palka wrote: On Mon, 15 Sep 2025, Eczbek wrote: From d70ac2b0a7b524829d22b3bb6bacbe1ef381c7fb Mon Sep 17 00:00:00 2001 From: Eczbek Date: Mon, 15 Sep 2025 19:37:20 -0400 Subject: [PATCH] c++: Fix lambdas with variadic parameters and static specifier [PR119048]

Re: [PATCH] c++: non-dep cmp op rewritten from <=> returning int [PR121779]

2025-09-18 Thread Jason Merrill
On 9/9/25 4:36 AM, Patrick Palka wrote: Bootstrapped and regttested on x86_64-pc-linux-gnu, does this look OK for trunk? OK. -- >8 -- Apparently an explicitly defined operator<=> isn't required to return std::foo_ordering, so build_min_non_dep_op_overload needs to be able to handle a (x <=>

[pushed] c++: tweak constexpr union diagnostic

2025-09-18 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- It's now possible to see an active member of a union that has not actually been initialized, so let's clarify the diagnostic. gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_component_reference): Clarify diagnostic. gcc/testsuite/Chang

[pushed] c++: improve constexpr clobber handling

2025-09-18 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- r16-3022 changed placement new to clobber the object, and improved constexpr handling to do more with clobbers. But it occurred to me that in a lot of cases we don't need to introduce a constructor_elt to represent an uninitialized member o

[pushed] c++: clobber class new-expressions

2025-09-18 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- Since Jakub's P2795R5 work removes the initial clobber from constructors, let's add a clobber for new of all non-empty classes. gcc/cp/ChangeLog: * init.cc (build_new_1): Clobber classes. gcc/testsuite/ChangeLog: * g++.dg

[pushed] c++: -Wmismatched-new-delete, -O0, new (nothrow)

2025-09-18 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- With new (nothrow) we need to check whether the allocation returned null, and the resulting COND_EXPR was confusing -Wmismatched-new-delete-2 at -O0. Let's help it out by appending the address if it's the same on both arms. gcc/cp/ChangeLog

Re: [RFC PATCH] c++, gimplify: Implement C++26 P2795R5 - Erroneous behavior for uninitialized reads [PR114457]

2025-09-18 Thread Jason Merrill
On 9/18/25 10:52 PM, Qing Zhao wrote: On Sep 17, 2025, at 12:08, Jakub Jelinek wrote: Hi! -ftrivial-auto-var-init= also calls .DEFERRED_INIT for temporaries if they have VOID_TYPE_P TARGET_EXPR_INITIAL (otherwise they are expanded as INIT_EXPR of the TARGET_EXPR_SLOT and TARGET_EXPR_INITIAL

Re: [RFC PATCH] c++, gimplify: Implement C++26 P2795R5 - Erroneous behavior for uninitialized reads [PR114457]

2025-09-18 Thread Jason Merrill
On 9/17/25 6:08 PM, Jakub Jelinek wrote: Hi! Here is my current version of the C++26 P2795R5 support. This now includes redirecting of forward/backward gotos which cross vacuous initializations for -std=c++26 and -ftrivial-auto-var-init={zero,pattern} by adding an artificial if (0) { lab1: v1 =

Re: [PATCH 2/2] c++/modules: Cleanup import handling [PR99682]

2025-09-17 Thread Jason Merrill
On 9/10/25 1:15 AM, Nathaniel Shead wrote: On Tue, Sep 09, 2025 at 07:38:46PM +0200, Jason Merrill wrote: On 9/9/25 4:49 PM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? (If you prefer I could also split up each fix into separate commits.) -- &g

Re: [PATCH] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-17 Thread Jason Merrill
On 9/8/25 4:29 PM, Jakub Jelinek wrote: On Mon, Sep 08, 2025 at 04:03:21PM +0200, Jason Merrill wrote: On 9/8/25 8:11 AM, Matthias Kretz wrote: Andrew Pinski [Friday, 5 September 2025, 22:57:02 CEST]: It seems that Clang and GCC disagree on mangling 80-Bit long double: https://compiler

Re: [WIP] C++ vs. -ftrivial-auto-var-init=

2025-09-17 Thread Jason Merrill
On 9/8/25 4:39 PM, Qing Zhao wrote: On Sep 6, 2025, at 10:10, Jason Merrill wrote: On 9/4/25 10:42 PM, Qing Zhao wrote: On Sep 4, 2025, at 16:15, Jakub Jelinek wrote: On Thu, Sep 04, 2025 at 07:47:17PM +, Qing Zhao wrote: On Sep 4, 2025, at 11:01, Jakub Jelinek wrote: On Thu, Sep

Re: [PATCH] c++/modules: Fix missed unwrapping of STAT_HACK in ADL [PR121893]

2025-09-12 Thread Jason Merrill
On 9/12/25 3:01 PM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK (obvious). -- >8 -- My r16-3559-gc2e567a6edb563 reworked ADL for modules, including a change to allow seeing module-linkage declarations if they only exist on the instantiation path

Re: [PATCH] fix whitespace of: [PATCH v4] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-12 Thread Jason Merrill
On 9/9/25 8:19 AM, Matthias Kretz wrote: Oh great, while replacing the '*' I messed up the indent. It's now using spaces where it should use a Tab. OK for trunk like this? OK (obvious). --- 8< -- Signed-off-by: Matthias Kretz gcc/cp/ChangeLog: * mangle.cc

Re: [PATCH/RFC] optionally capture suppressed diagnostics in SARIF output [PR121039]

2025-09-12 Thread Jason Merrill
On 9/10/25 4:59 PM, David Malcolm wrote: GCC has long supported the ability to selectively ignore warnings using "#pragma GCC diagnostic ignored"; see: https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Pragmas.html#index-pragma_002c-diagnostic The SARIF standard supports capturing suppression in

Re: [PATCH] c++: pack indexing is a non-deduced context [PR121795]

2025-09-11 Thread Jason Merrill
On 9/10/25 6:59 PM, Marek Polacek wrote: On Wed, Sep 10, 2025 at 11:23:42AM -0400, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/15? -- >8 -- We weren't explicitly treating a pack index specifier as a non-deduced context. PR c++/12

Re: [PATCH] c++: Don't upgrade TLS model if TLS model isn't set.

2025-09-11 Thread Jason Merrill
On 9/11/25 1:19 AM, H.J. Lu wrote: Don't upgrade TLS model when cplus_decl_attributes is called on a thread local variable whose TLS model isn't set yet. OK. gcc/cp/ PR c++/121889 * decl2.cc (cplus_decl_attributes): Don't upgrade TLS model if TLS model isn't set yet.

Re: [PATCH] c++: Fix null deref in maybe_diagnose_standard_trait [PR121859]

2025-09-10 Thread Jason Merrill
On 9/10/25 2:13 PM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- A static member template doesn't always have a DECL_INITIAL, as in the below testcase, and so checking its TREE_CODE performs a null-pointer dereference. I don't think we

Re: [PATCH] c++, v3: Change mangling of Intel/Motorola extended long double literals

2025-09-10 Thread Jason Merrill
On 9/10/25 10:18 AM, Jakub Jelinek wrote: On Wed, Sep 10, 2025 at 10:06:07AM +0200, Jason Merrill wrote: It looks like these tests won't run on m68k, can you make at least the -2 test run (and pass) there? Sure, tested there just with a cross (and only on those 2 new tests). OK, t

Re: [PATCH 2/2] c++/modules: Cleanup import handling [PR99682]

2025-09-09 Thread Jason Merrill
On 9/9/25 4:49 PM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? (If you prefer I could also split up each fix into separate commits.) -- >8 -- This patch fixes some issues with import handling. The main functional change is to allow importing a module

Re: [PATCH 1/2] c++/modules: Create helper to get current TU's module_state

2025-09-09 Thread Jason Merrill
On 9/9/25 4:47 PM, Nathaniel Shead wrote: No functional change intended. Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- A lot of places use (*modules)[0] to refer to the module state for the current TU. This is a bit awkward to type and not particularly clear

Re: [WIP] v2: C++ vs. -ftrivial-auto-var-init=

2025-09-09 Thread Jason Merrill
On 9/9/25 4:11 PM, Jakub Jelinek wrote: On Fri, Sep 05, 2025 at 05:19:06PM +0200, Jason Merrill wrote: Regarding temporaries, I wonder if we want to .DEFERRED_INIT them when expanding TARGET_EXPRs in the gimplifier (but whether to do that always when flag_auto_var_init

Re: [PATCH] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-08 Thread Jason Merrill
On 9/8/25 4:33 PM, Matthias Kretz wrote: On 8 September 2025 16:03:21 CEST, Jason Merrill wrote: On 9/8/25 8:11 AM, Matthias Kretz wrote: Andrew Pinski [Friday, 5 September 2025, 22:57:02 CEST]: It seems that Clang and GCC disagree on mangling 80-Bit long double: https://compiler

Re: [PATCH] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-08 Thread Jason Merrill
On 9/8/25 8:11 AM, Matthias Kretz wrote: Andrew Pinski [Friday, 5 September 2025, 22:57:02 CEST]: It seems that Clang and GCC disagree on mangling 80-Bit long double: https://compiler-explorer.com/z/W1d64PjrP I like Clang's interpretation of https://itanium-cxx-abi.github.io/cxx-abi/ abi.html#

Re: [RFC] c++: Guidance on P2686R4 [PR117784]

2025-09-07 Thread Jason Merrill
On 8/29/25 8:54 AM, Jakub Jelinek wrote: Hi! So, I had a look at the remaining part of C++26 P2686R4, which I think we really should implement for GCC 16 because people are already filing PRs about constexpr structured bindings or expansion statements not working the way they should in some case

Re: [PATCH] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-06 Thread Jason Merrill
On 9/5/25 10:57 PM, Andrew Pinski wrote: On Fri, Sep 5, 2025 at 12:58 PM Matthias Kretz wrote: Matthias Kretz [Friday, 5 September 2025, 21:49:23 CEST]: How about an assert that if words > 0, bitsize % 32 == 0? I actually thought about an assert that bytes == 2 when words == 0. I don't thin

Re: [PATCH] c++: Fix mangling of _Float16 template args [PR121801]

2025-09-06 Thread Jason Merrill
On 9/5/25 1:03 PM, Matthias Kretz wrote: Okay for trunk? What about backports? Regarding backports, I'm generally reluctant to change mangling within a release unless the old behavior would always fail loudly. This case looks borderline; it could have worked for a single overload. So I'm i

Re: [WIP] C++ vs. -ftrivial-auto-var-init=

2025-09-06 Thread Jason Merrill
On 9/4/25 10:42 PM, Qing Zhao wrote: On Sep 4, 2025, at 16:15, Jakub Jelinek wrote: On Thu, Sep 04, 2025 at 07:47:17PM +, Qing Zhao wrote: On Sep 4, 2025, at 11:01, Jakub Jelinek wrote: On Thu, Sep 04, 2025 at 02:45:16PM +0200, Jakub Jelinek via Gcc wrote: On Wed, Sep 03, 2025 at 03:

Re: [WIP] C++ vs. -ftrivial-auto-var-init=

2025-09-06 Thread Jason Merrill
On 9/6/25 4:24 PM, Jakub Jelinek wrote: On Sat, Sep 06, 2025 at 04:10:16PM +0200, Jason Merrill wrote: 3. Should the paddings of the auto variables or temporaries be zero-initialized per the standard? No. Okay. I disagree, I think the padding should also be initialized; the specification

Re: [PATCH v2 1/3] c++: Update TLS model after processing a TLS variable

2025-09-06 Thread Jason Merrill
On 9/6/25 12:40 AM, H.J. Lu wrote: Set a tentative TLS model in grokvardecl and update TLS mode with the default TLS access model after a TLS variable has been fully processed if the default TLS access model is stronger. gcc/cp/ PR c++/107393 * decl.cc (grokvardecl): Set a tenta

Re: [PATCH v2 1/3] c++: Update TLS model after processing a TLS variable

2025-09-06 Thread Jason Merrill
On 9/6/25 3:30 PM, H.J. Lu wrote: On Sat, Sep 6, 2025 at 6:11 AM Jason Merrill wrote: On 9/6/25 12:40 AM, H.J. Lu wrote: Set a tentative TLS model in grokvardecl and update TLS mode with the default TLS access model after a TLS variable has been fully processed if the default TLS access

Re: [PATCH] c++/modules: Fix exported using-directive of imported namespace [PR121702]

2025-09-06 Thread Jason Merrill
On 9/6/25 7:27 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- Currently we represent exported using-directives as a list of indices into the namespace array that we stream. However this list of namespaces doesn't include any namespac

Re: [PATCH v2] c++/modules: Support ADL on non-discarded GM entities [PR121705]

2025-09-06 Thread Jason Merrill
On 9/6/25 7:54 AM, Nathaniel Shead wrote: On Fri, Sep 05, 2025 at 04:36:23PM +0200, Jason Merrill wrote: On 8/31/25 9:24 AM, Nathaniel Shead wrote: Note: the tests in this patch depend on https://gcc.gnu.org/pipermail/gcc-patches/2025-August/693810.html. Bootstrapped and regtested on x86_64

Re: [WIP] C++ vs. -ftrivial-auto-var-init=

2025-09-05 Thread Jason Merrill
On 9/4/25 11:01 AM, Jakub Jelinek wrote: On Thu, Sep 04, 2025 at 02:45:16PM +0200, Jakub Jelinek via Gcc wrote: On Wed, Sep 03, 2025 at 03:38:53PM +0200, Jakub Jelinek via Gcc wrote: But there is one thing the paper doesn't care about, which looks like a show stopper to me, in particular the st

Re: [WIP] C++ vs. -ftrivial-auto-var-init=

2025-09-05 Thread Jason Merrill
On 9/4/25 3:47 PM, Qing Zhao wrote: On Sep 4, 2025, at 11:01, Jakub Jelinek wrote: On Thu, Sep 04, 2025 at 02:45:16PM +0200, Jakub Jelinek via Gcc wrote: On Wed, Sep 03, 2025 at 03:38:53PM +0200, Jakub Jelinek via Gcc wrote: But there is one thing the paper doesn't care about, which looks

Re: [PATCH] c++/modules: Support ADL on non-discarded GM entities [PR121705]

2025-09-05 Thread Jason Merrill
On 8/31/25 9:24 AM, Nathaniel Shead wrote: Note: the tests in this patch depend on https://gcc.gnu.org/pipermail/gcc-patches/2025-August/693810.html. Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- [basic.lookup.argdep] p4 says that ADL also finds declarations of func

Re: [PATCH] c++: constant non-dep init folding vs FIELD_DECL access [PR97740]

2025-09-03 Thread Jason Merrill
On 9/2/25 5:07 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-cp-linux-gnu, does this look OK for trunk and eventual backports? Oops, I didn't see this until after I came up with my own fix, but I actually like your approach better. OK. In future please assign PRs to yourself

Re: [PATCH] c++/modules: Mark implicit inline namespaces as purview [PR121724]

2025-09-03 Thread Jason Merrill
On 9/1/25 7:31 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk and 15? OK. -- >8 -- When we push an existing namespace within the module purview for the first time, we also need to mark any parent inline namespaces as purview to not confuse the stre

Re: [PATCH] c++/modules: Fix ADL [PR117658]

2025-09-02 Thread Jason Merrill
On 8/31/25 9:21 AM, Nathaniel Shead wrote: On Fri, Aug 29, 2025 at 12:33:23PM +0200, Jason Merrill wrote: On 8/24/25 9:04 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- On looking again at [basic.lookup.argdep] p4, I believe GCC has

Re: [PATCH] c++, contracts: Simplify contracts headers [NFC].

2025-09-02 Thread Jason Merrill
On 8/30/25 12:45 PM, Iain Sandoe wrote: A small amount of preparation for upstreaming the C++26 implementation. We need to add (and share) some APIs and then, at some point, remove the c++2a edition which was not adopted. Keeping the related material together is helpful at this stage. Tested on

Re: [PATCH 1/2] c++: Update DECL_TLS_MODEL after processing a TLS variable

2025-09-02 Thread Jason Merrill
On 8/13/25 11:54 AM, H.J. Lu wrote: Set a tentative TLS model in grokvardecl and update DECL_TLS_MODEL with the default TLS access model after a TLS variable has been fully processed if the default TLS access model is stronger. If the non-template problem is needing to recalculate the default a

Re: [PATCH v2] c++: Fix miscompilation on array subscription with COND_EXPR as the array

2025-08-29 Thread Jason Merrill
On 8/28/25 12:33 PM, Sirui Mu wrote: Hello, This is the 2nd version of the patch. Changes made since the initial version: - Implemented Jason's suggestions, move the declaration of first down. - Add signed-off-by to the commit. Please preserve the rationale in later revisions of the patc

Re: [PATCH] c++, libstdc++, v4: Implement C++23 P2674R1 - A trait for implicit lifetime types

2025-08-29 Thread Jason Merrill
On 8/29/25 6:22 AM, Jakub Jelinek wrote: On Fri, Aug 29, 2025 at 11:40:10AM +0200, Jason Merrill wrote: --- gcc/cp/semantics.cc.jj 2025-08-28 10:50:43.432763513 +0200 +++ gcc/cp/semantics.cc 2025-08-28 16:52:48.006806831 +0200 @@ -13591,6 +13591,38 @@ trait_expr_value (cp_trait_kind kind

Re: [PATCH] c++/modules: Fix ADL [PR117658]

2025-08-29 Thread Jason Merrill
On 8/24/25 9:04 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- On looking again at [basic.lookup.argdep] p4, I believe GCC hasn't fully implemented the wording here for ADL. This patch fixes two issues. First, 4.3 indicates that a function

Re: [PATCH] c++, libstdc++, v3: Implement C++23 P2674R1 - A trait for implicit lifetime types

2025-08-29 Thread Jason Merrill
On 8/28/25 2:38 PM, Jakub Jelinek wrote: On Thu, Aug 28, 2025 at 08:11:04PM +0200, Tomasz Kaminski wrote: Similar test, for Q being a base class, this is also aggregate in C++20. And if you could reorganize the library test so satic_assert follows the type definition, that would be great. Done

[pushed] c++: > in lambda in template arg [PR107953]

2025-08-28 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- As with PR116928, we need to set greater_than_is_operator_p within the lambda delimiters. PR c++/107953 gcc/cp/ChangeLog: * parser.cc (cp_parser_lambda_expression): Set greater_than_is_operator_p. gcc/testsuite/Ch

Re: [PATCH] c++: Fix miscompilation on array subscription with COND_EXPR as the array

2025-08-28 Thread Jason Merrill
On 8/28/25 9:48 AM, Sirui Mu wrote: Hello, The following minimum reproducer would miscompile with vanilla gcc: extern int x[10], y[10]; bool g(); void f() { 0[g() ? x : y] = 1; } gcc would mistakenly treat the subexpression (g() ? x : y) as a prvalue and move that array to stack. The

Re: [PATCH v10 06/13] c: c++: Add target_[version/clones] to decl diagnostics formatting.

2025-08-28 Thread Jason Merrill
On 8/28/25 10:22 AM, Alfie Richards wrote: The 08/28/2025 15:56, Jason Merrill wrote: On 8/28/25 8:59 AM, Alfie Richards wrote: The 08/28/2025 14:43, Jason Merrill wrote: On 8/28/25 5:49 AM, alfie.richa...@arm.com wrote: From: Alfie Richards Adds the target_version and target_clones

Re: [PATCH] fixincludes: Skip pthread_incomplete_struct_argument for modern glibc [PR118009]

2025-08-28 Thread Jason Merrill
On 8/28/25 9:56 AM, Jonathan Wakely wrote: Ping Original: https://gcc.gnu.org/pipermail/gcc-patches/2025-August/692933.html On 20/08/25 17:30 +0100, Jonathan Wakely wrote: The pthread_incomplete_struct_argument fix was intended for ancient versions of Glibc (only 2.3.3 and 2.3.4, I believe). F

Re: std::start_lifetime_as vs. aliasing

2025-08-28 Thread Jason Merrill
On 8/28/25 9:52 AM, Jakub Jelinek wrote: On Thu, Aug 28, 2025 at 02:08:12PM +0200, Jason Merrill wrote: So, do you think for P2590R2 we want a purely library implementation which does nothing (well, define the needed templates)? Or do you prefer some builtin which will do nothing initially but

Re: [PATCH v10 06/13] c: c++: Add target_[version/clones] to decl diagnostics formatting.

2025-08-28 Thread Jason Merrill
On 8/28/25 8:59 AM, Alfie Richards wrote: The 08/28/2025 14:43, Jason Merrill wrote: On 8/28/25 5:49 AM, alfie.richa...@arm.com wrote: From: Alfie Richards Adds the target_version and target_clones attributes to diagnostic messages for target_version semantics. This is because the

Re: [PATCH v10 07/13] c++: Refactor FMV frontend conflict and merging logic and hooks.

2025-08-28 Thread Jason Merrill
On 8/28/25 5:49 AM, alfie.richa...@arm.com wrote: From: Alfie Richards This change refactors FMV handling in the frontend to allows greater reasoning about versions in shared code. This is needed for allowing target_clones and target_versions to be used together in a function set, as there is

Re: [PATCH v10 06/13] c: c++: Add target_[version/clones] to decl diagnostics formatting.

2025-08-28 Thread Jason Merrill
On 8/28/25 5:49 AM, alfie.richa...@arm.com wrote: From: Alfie Richards Adds the target_version and target_clones attributes to diagnostic messages for target_version semantics. This is because the target_version/target_clones attributes affect the identity of the decls, so need to be represent

Re: [PATCH v10 05/13] fmv: c++: Change target_version semantics to follow ACLE specification.

2025-08-28 Thread Jason Merrill
On 8/28/25 5:49 AM, alfie.richa...@arm.com wrote: From: Alfie Richards This patch changes the semantics of target_version and target_clones attributes to match the behavior described in the Arm C Language extension. The changes to behavior are: - The scope and signature of an FMV function set

Re: [PATCH v10 04/13] fmv: c++: Add check_target_clone hook for filtering target_clone versions.

2025-08-28 Thread Jason Merrill
On 8/28/25 5:49 AM, alfie.richa...@arm.com wrote: From: Alfie Richards This patch introduces the TARGET_CHECK_TARGET_CLONE_VERSION hook which is used to determine if a target_clones version string parses. The hook has a flag to enable emitting diagnostics. This is as specified in the Arm C La

Re: [PATCH] libstdc++: library side of C++26 P2786R13 - Trivial Relocatability [PR119064]

2025-08-28 Thread Jason Merrill
On 8/28/25 5:19 AM, Jakub Jelinek wrote: On Thu, Aug 28, 2025 at 10:49:36AM +0200, Jason Merrill wrote: I know, but P2590R2 is not implemented yet and as written in https://gcc.gnu.org/PR106658 I have actually no idea what needs to be done if anything on the compiler side. Because at least the

Re: [PATCH v2] c++/modules: Add explanatory note for incomplete types with definition in different module [PR119844]

2025-08-28 Thread Jason Merrill
On 8/28/25 7:26 AM, Nathaniel Shead wrote: On Wed, Aug 27, 2025 at 04:43:57PM +0200, Jason Merrill wrote: On 8/27/25 8:29 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. While playing around again quickly before submitting I noticed that

Re: [PATCH] c++, v3: Fix ICE with parameter uses in expansion stmts [PR121575]

2025-08-28 Thread Jason Merrill
On 8/27/25 2:04 PM, Jakub Jelinek wrote: On Wed, Aug 27, 2025 at 01:45:38PM +0200, Jason Merrill wrote: would be wrong. Guess if (DECL_CONTEXT (t) && !uses_template_parms (DECL_CONTEXT (t))) RETURN (t); would fix these ICEs, shall I go w

Re: [PATCH] libstdc++: library side of C++26 P2786R13 - Trivial Relocatability [PR119064]

2025-08-28 Thread Jason Merrill
On 7/14/25 6:23 AM, Jakub Jelinek wrote: On Mon, Jul 14, 2025 at 12:11:18PM +0200, Tomasz Kaminski wrote: + if (__builtin_expect(__fwd, true)) We have a preference to use [[likely]] attribute when possible. Ok, changed to if (__fwd) [[likely]] in my copy. + { +

Re: [PATCH] c++, v2: Fix auto return type deduction with expansion statements [PR121583]

2025-08-28 Thread Jason Merrill
On 8/27/25 2:05 PM, Jakub Jelinek wrote: On Mon, Aug 25, 2025 at 04:00:37PM -0400, Jason Merrill wrote: On 8/25/25 12:02 PM, Jakub Jelinek wrote: On Mon, Aug 25, 2025 at 11:55:24AM -0400, Patrick Palka wrote: The following patch fixes that by testing DECL_TEMPLATE_INFO, dunno what else would

Re: [PATCH] c++/modules: Add explanatory note for incomplete types with definition in different module [PR119844]

2025-08-27 Thread Jason Merrill
On 8/27/25 8:29 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- The confusion in the PR arose because the definition of 'User' in a separate named module did not provide an implementation for the forward-declaration in the global modul

Re: [PATCH v2 1/3] AArch64: Support C/C++ operations on svbool_t

2025-08-27 Thread Jason Merrill
On 8/27/25 6:36 AM, Tejas Belagod wrote: +tree +c_common_bool_type (unsigned int precision, bool unsigned_p) +{ +  /* Standard boolean types.  */ +  if (precision == TYPE_PRECISION (boolean_type_node) +  && unsigned_p == TYPE_UNSIGNED (boolean_type_node)) +    return boolean_type_node; + + 

Re: [PATCH] c++: Fix up cpp_warn on __STDCPP_FLOAT*_T__ [PR121520]

2025-08-27 Thread Jason Merrill
On 8/27/25 4:03 AM, Jakub Jelinek wrote: Hi! I got the cpp_warn on __STDCPP_FLOAT*_T__ if we aren't predefining those wrong, so e.g. on powerpc64le we don't diagnose #undef __STDCPP_FLOAT16_T__. I've added it as else if on the if (c_dialect_cxx () && cxx_dialect > cxx20 && !floatn_nx_types[i].ex

Re: [PATCH] c, c++: Allow &__real__ static_var in constant expressions [PR121678]

2025-08-27 Thread Jason Merrill
On 8/27/25 4:13 AM, Jakub Jelinek wrote: Hi! When looking at constexpr references, I've noticed staticp handles COMPONENT_REFs and ARRAY_REFs (the latter if the index is INTEGER_CST), but not {REAL,IMAG}PART_EXPR. I think that is incorrect and causes rejection of constexpr (for C++) or static c

Re: [PATCH] c++, v2: Fix ICE with parameter uses in expansion stmts [PR121575]

2025-08-27 Thread Jason Merrill
On 8/27/25 5:22 AM, Jakub Jelinek wrote: On Tue, Aug 26, 2025 at 12:26:17AM +0200, Jakub Jelinek wrote: Unfortunately that version (unlike the previous one) regresses: ... UNRESOLVED: std/ranges/access/rend.cc -std=gnu++26 compilation failed to produce executable Will try to investigate wha

Re: [PATCH v9 06/13] c/c++: Add target_[version/clones] to decl diagnostics formatting.

2025-08-26 Thread Jason Merrill
On 8/26/25 6:39 AM, Alfie Richards wrote: The 08/19/2025 14:06, Jason Merrill wrote: On 8/19/25 4:49 AM, Alfie Richards wrote: Adds the target_version and target_clones attributes to diagnostic messages for target_version semantics. This is because the target_version/target_clones attributes

Re: [PATCH v9 05/13] fmv: Change target_version semantics to follow ACLE specification.

2025-08-26 Thread Jason Merrill
On 8/26/25 6:33 AM, Alfie Richards wrote: The 08/22/2025 12:22, Jason Merrill wrote: On 8/19/25 4:48 AM, Alfie Richards wrote: This patch changes the semantics of target_version and target_clones attributes to match the behavior described in the Arm C Language extension. The changes to

Re: [PATCH] c++: Fix auto return type deduction with expansion statements [PR121583]

2025-08-25 Thread Jason Merrill
On 8/25/25 12:02 PM, Jakub Jelinek wrote: On Mon, Aug 25, 2025 at 11:55:24AM -0400, Patrick Palka wrote: The following patch fixes that by testing DECL_TEMPLATE_INFO, dunno what else would be more appropriate for this function is a template, maybe decl_dependent_p? I was going to suggest just

Re: [PATCH] c++, v2: Fix ICE with parameter uses in expansion stmts [PR121575]

2025-08-25 Thread Jason Merrill
On 8/25/25 10:53 AM, Jakub Jelinek wrote: On Mon, Aug 25, 2025 at 09:44:29AM -0400, Jason Merrill wrote: --- gcc/cp/pt.cc.jj 2025-08-23 15:00:04.262787988 +0200 +++ gcc/cp/pt.cc2025-08-23 15:51:08.726081054 +0200 @@ -22321,6 +22321,13 @@ tsubst_expr (tree t, tree args, tsubst_f

Re: [PATCH] c++: Fix ICE with parameter uses in expansion stmts [PR121575]

2025-08-25 Thread Jason Merrill
On 8/25/25 2:52 AM, Jakub Jelinek wrote: Hi! The following testcase shows an ICE when a parameter of a non-template function is referenced in expansion stmt body. tsubst_expr in that case assumes that either the PARM_DECL has registered local specialization, or is this argument or it is in unev

Re: [PATCH] c++: Implement C++ CWG3048 - Empty destructuring expansion statements

2025-08-25 Thread Jason Merrill
On 8/25/25 2:56 AM, Jakub Jelinek wrote: Hi! The following patch implements the proposed resolution of https://cplusplus.github.io/CWG/issues/3048.html Instead of rejecting structured binding size it just builds a normal decl rather than structured binding declaration. Bootstrapped/regtested on

Re: [PATCH] c++: Check for *jump_target earlier in cxx_bind_parameters_in_call [PR121601]

2025-08-25 Thread Jason Merrill
On 8/25/25 2:48 AM, Jakub Jelinek wrote: Hi! The following testcase ICEs, because the /* Check we aren't dereferencing a null pointer when calling a non-static member function, which is undefined behaviour. */ if (i == 0 && DECL_OBJECT_MEMBER_FUNCTION_P (fun)

Re: [PATCH] c++: Fix greater-than operator in braced-init-lists [PR116928]

2025-08-25 Thread Jason Merrill
On 8/23/25 1:24 AM, Eczbek wrote: From 0210a1a410cfafd79521e15cd96682ed3d5b4943 Mon Sep 17 00:00:00 2001 From: Eczbek Date: Thu, 5 Jun 2025 14:27:48 -0400 Subject: [PATCH] c++: [PR116928] PR c++/116928 gcc/cp/ChangeLog: * parser.cc (cp_parser_braced_list): You're missing a descri

Re: [PATCH] c++/modules: Provide definitions of synthesized methods outside their defining module [PR120499]

2025-08-25 Thread Jason Merrill
On 8/24/25 9:05 AM, Nathaniel Shead wrote: On Sat, Aug 23, 2025 at 01:18:19PM -0400, Patrick Palka wrote: On Fri, 22 Aug 2025, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- In the PR, we're getting a linker error from _Vector_impl's destruct

Re: [PATCH v4] driver: Rework for_each_path using C++

2025-08-22 Thread Jason Merrill
Pushed, thanks! On 8/22/25 5:37 PM, John Ericson wrote: From: John Ericson The old C-style was cumbersome make making one responsible for manually creating and passing in two parts a closure (separate function and *_info class for closed-over variables). With C++ lambdas, we can just: - deri

Re: [PATCH v3 3/3] driver: Rework for_each_path without OOP

2025-08-22 Thread Jason Merrill
On 8/21/25 1:33 AM, John Ericson wrote: From: John Ericson This time use no classes, virtual methods. Just use higher order functions using templates. Now it's even shorter than before --- which is also shorter than the no-lambda, pure OOP original --- but at the cost of some overkill template

Re: [PATCH v3 2/2] driver: `add_to_obstack` and `find_a_file` redo with lambdas

2025-08-22 Thread Jason Merrill
On 8/21/25 1:01 AM, John Ericson wrote: A follow-up from "driver: Rework for_each_path using C++" These types are, for all intents and purposes, single-use closure environment types. It is much more ergonomic to juse use lambdas for this. On IRC there was concern about static dispatch and compi

Re: [PATCH] c++/modules: Provide definitions of synthesized methods outside their defining module [PR120499]

2025-08-22 Thread Jason Merrill
On 8/22/25 2:02 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- In the PR, we're getting a linker error from _Vector_impl's destructor never getting emitted. This is because of a combination of factors: 1. in imp-member-4_a, the dest

Re: [PATCH v9 05/13] fmv: Change target_version semantics to follow ACLE specification.

2025-08-22 Thread Jason Merrill
On 8/19/25 4:48 AM, Alfie Richards wrote: This patch changes the semantics of target_version and target_clones attributes to match the behavior described in the Arm C Language extension. The changes to behavior are: - The scope and signature of an FMV function set is now that of the default

Re: [PATCH v9 02/13] fmv: Refactor FMV name mangling.

2025-08-22 Thread Jason Merrill
On 8/19/25 4:47 AM, Alfie Richards wrote: This patch is an overhaul of how FMV name mangling works. Previously mangling logic was duplicated in several places across both target specific and independent code. This patch changes this such that all mangling is done in targetm.mangle_decl_assembler_

[pushed] c++: constexpr clobber of const [PR121068]

2025-08-21 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- Since r16-3022, 20_util/variant/102912.cc was failing in C++20 and above due to wrong errors about destruction modifying a const object; destruction is OK. PR c++/121068 gcc/cp/ChangeLog: * constexpr.cc (cxx_eval_store_exp

Re: [PATCH v2 2/2] driver: `add_to_obstack` and `find_a_file` redo with lambdas

2025-08-20 Thread Jason Merrill
On 8/13/25 2:48 PM, John Ericson wrote: A follow-up from "driver: Rework for_each_path using C++" These types are, for all intents and purposes, single-use closure environment types. It is much more ergonomic to just use lambdas for this. On IRC there was concern about static dispatch and compi

Re: [PATCH v2] driver: Rework for_each_path using C++

2025-08-20 Thread Jason Merrill
On 8/13/25 11:45 AM, John Ericson wrote: The old C-style was cumbersome make making one responsible for manually create and pass a closure (separate function and *_info class for closed-over variables). I would have liked to redo this with C++ lambdas, so we could: - derive environment types im

[pushed] c++: pointer to auto member function [PR120757]

2025-08-20 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- Here r13-1210 correctly changed &A::foo to not be considered type-dependent, but tsubst_expr of the OFFSET_REF got confused trying to tsubst a type that involved auto. Fixed by getting the type from the member rather than tsubst. P

Re: [PATCH] c++: lambda capture and shadowing [PR121553]

2025-08-20 Thread Jason Merrill
On 8/20/25 10:53 AM, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? OK. -- >8 -- P2036 says that this: [x=1]{ int x; } should be rejected, but with my P2036 we started giving an error for the attached testcase as well, breaking Dolphin. So let's keep t

Re: [PATCH v9 07/13] c++: Refactor FMV frontend conflict and merging logic and hooks.

2025-08-19 Thread Jason Merrill
On 8/19/25 4:49 AM, Alfie Richards wrote: This change refactors FMV handling in the frontend to allows greater reasoning about versions in shared code. This is needed for allowing target_clones and target_versions to be used together in a function set, as there is then two distinct concerns when

Re: [PATCH v9 06/13] c/c++: Add target_[version/clones] to decl diagnostics formatting.

2025-08-19 Thread Jason Merrill
On 8/19/25 4:49 AM, Alfie Richards wrote: Adds the target_version and target_clones attributes to diagnostic messages for target_version semantics. This is because the target_version/target_clones attributes affect the identity of the decls, so need to be represented in diagnostics for them. Af

Re: [PATCH v2] c++: Fix ICE on mangling invalid compound requirement [PR120618]

2025-08-19 Thread Jason Merrill
Pushed, thanks! On 8/18/25 11:32 PM, Ben Wu wrote: Looks like I mispelled "Merrill". Here is the corrected patch. -Ben On Mon, Aug 18, 2025 at 7:31 PM Ben Wu > wrote: Sorry about that, I'm not sure why the formatting issues are there. Gmail seems to re

Re: [PATCH v2] c++: Fix ICE on mangling invalid compound requirement [PR120618]

2025-08-18 Thread Jason Merrill
-by: Jason Merrill --- gcc/cp/parser.cc| 9 ++--- gcc/testsuite/g++.dg/concepts/pr120618.C| 13 + gcc/testsuite/g++.dg/cpp2a/concepts-requires5.C | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 gcc

Re: [PATCH] c++/modules: Fix exporting using-decls of unattached purview functions [PR120195]

2025-08-18 Thread Jason Merrill
On 8/16/25 11:06 PM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- We have logic to adjust a function decl if it gets re-declared as a using-decl with different purviewness, but we also need to do the same if it gets redeclared with diff

Re: [PATCH] testsuite: Fix PR108080 testcase for some targets [PR121396]

2025-08-18 Thread Jason Merrill
On 8/16/25 11:13 PM, Nathaniel Shead wrote: Tested on x86_64-pc-linux-gnu and verified with a powerpc64-linux-gnu cross. OK for trunk and 15? OK (obvious) -- >8 -- I added a testcase for the (temporary) warning that we don't currently support the 'gnu::optimize' or 'gnu::target' attributes

Re: [PATCH] c++: constrained corresponding using from partial spec [PR121351]

2025-08-18 Thread Jason Merrill
On 8/18/25 11:36 AM, Patrick Palka wrote: Bootstrapped anh regtested on x86_64-pc-linux-gnu, does this look OK for trunk and 15? OK. -- >8 -- When a using refers to a member from a partial specialization, we need to substitute the arguments relative to partial specialization into the constra

Re: [PATCH] c++: Add testcases for the defarg part of P1766R1 [PR121552]

2025-08-16 Thread Jason Merrill
On 8/16/25 7:48 AM, Jakub Jelinek wrote: On Sat, Aug 16, 2025 at 09:14:23AM -0400, Jason Merrill wrote: I don't think this (or the following in this file) should be errors; we error currently because we don't implement textual deduplication (PR99000), but since the default argumen

Re: [PATCH v2 1/3] AArch64: Support C/C++ operations on svbool_t

2025-08-16 Thread Jason Merrill
On 7/31/25 5:36 AM, Tejas Belagod wrote: Support a subset of C/C++ operations (bitwise, conditional etc.) on svbool_t. gcc/ChangeLog: * c-family/c-common.cc (c_build_vec_convert): Support vector boolean types for __builtin_convertvector (). (c_common_bool_type): New. Gi

Re: [PATCH v2] c++: Implement P2115R0 linkage changes for unnamed unscoped enums [PR120503]

2025-08-16 Thread Jason Merrill
On 8/15/25 4:04 PM, Nathaniel Shead wrote: On Sun, Aug 10, 2025 at 03:33:26PM -0700, Jason Merrill wrote: On 8/8/25 9:46 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? Alternatively, if preferred I also experimented with a patch that cached the

Re: [PATCH] c++: Add testcases for the defarg part of P1766R1 [PR121552]

2025-08-16 Thread Jason Merrill
On 8/15/25 4:28 PM, Nathaniel Shead wrote: On Fri, Aug 15, 2025 at 12:38:01PM +0200, Jakub Jelinek wrote: Hi! The following patch adds some testcases for the default argument (function and template) part of the paper, making sure we diagnose multiple defargs in the same TU and when visible in m

  1   2   3   4   5   6   7   8   9   10   >