Re: [PATCH v2 1/2] c++: Standardise errors for module_may_redeclare

2024-04-25 Thread Jason Merrill
On 4/19/24 09:18, Nathaniel Shead wrote: On Mon, Apr 15, 2024 at 02:49:35PM +1000, Nathaniel Shead wrote: I took another look at this patch and have split it into two, one (this one) to standardise the error messages used and prepare 'module_may_redeclare' for use with temploid friends, and

Re: [PATCH] c++, v2: Fix constexpr evaluation of parameters passed by invisible reference [PR111284]

2024-04-25 Thread Jason Merrill
On 4/23/24 08:52, Jakub Jelinek wrote: On Mon, Apr 15, 2024 at 02:19:36PM +0200, Jakub Jelinek wrote: They weren't the same, one was trying to evaluate the convert_from_reference with vc_glvalue, the other evaluates it without that and with vc_prvalue. Now, I guess the + /* Undo

Re: [PATCH] c++, v4: Retry the aliasing of base/complete cdtor optimization at import_export_decl time [PR113208]

2024-04-25 Thread Jason Merrill
On 4/25/24 07:22, Jakub Jelinek wrote: On Thu, Apr 25, 2024 at 02:02:32PM +0200, Jakub Jelinek wrote: I've tried the following patch, but unfortunately that lead to large number of regressions: +FAIL: g++.dg/cpp0x/initlist25.C -std=c++17 (test for excess errors) So the reduced testcase for

Re: [PATCH] c++, v3: Retry the aliasing of base/complete cdtor optimization at import_export_decl time [PR113208]

2024-04-24 Thread Jason Merrill
On 4/24/24 15:47, Jakub Jelinek wrote: On Wed, Apr 24, 2024 at 06:39:33PM -0400, Jason Merrill wrote: --- gcc/cp/decl2.cc.jj 2024-04-23 14:49:41.933186265 +0200 +++ gcc/cp/decl2.cc 2024-04-24 15:17:09.043625729 +0200 @@ -3314,7 +3314,16 @@ tentative_decl_linkage (tree decl

Re: [PATCH] c++, v3: Retry the aliasing of base/complete cdtor optimization at import_export_decl time [PR113208]

2024-04-24 Thread Jason Merrill
On 4/24/24 09:16, Jakub Jelinek wrote: On Wed, Apr 24, 2024 at 10:16:05AM +0100, Jonathan Wakely wrote: That fixes the testcases too, but seems to regress +FAIL: libstdc++-abi/abi_check There are explicit instantiation definitions that should instantiate those types:

Re: [PATCH] c++: fix source printing for "required from here" message

2024-04-24 Thread Jason Merrill
On 4/24/24 13:22, Patrick Palka wrote: Tested on x86_64-pc-linux-gnu, full bootstrap+regtest in progress, does this look OK if successful? -- >8 -- It seems the diagnostic machinery's source line printing respects the pretty printer prefix, but this is undesirable for the call to

Re: [PATCH] c++/modules testsuite: avoid expensive ggc-min-expand=0

2024-04-24 Thread Jason Merrill
On 4/24/24 05:49, Patrick Palka wrote: On Tue, 23 Apr 2024, Jason Merrill wrote: On 4/23/24 11:28, Patrick Palka wrote: Tested on x86_64-pc-linux-gnu, does this look OK for trunk? Is the test being run for multiple standard levels? I'd rather restrict it to one and keep fully testing GC

Re: [PATCH] c++/modules testsuite: avoid expensive ggc-min-expand=0

2024-04-23 Thread Jason Merrill
On 4/23/24 11:28, Patrick Palka wrote: Tested on x86_64-pc-linux-gnu, does this look OK for trunk? Is the test being run for multiple standard levels? I'd rather restrict it to one and keep fully testing GC-safety. -- >8 -- The below testcase uses --param=ggc-min-expand=0 which forces a

Re: [PATCH] c++/modules: deduced return type merging [PR114795]

2024-04-23 Thread Jason Merrill
On 4/23/24 09:41, Patrick Palka wrote: Tested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- When merging an imported function template specialization with an existing one, if the existing one has an undeduced return type and the imported one's is already deduced, we need to

Re: [PATCH] c++: Fix ICE with xobj parms and maybe incomplete decl-specifiers

2024-04-23 Thread Jason Merrill
On 4/21/24 19:59, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- This fixes a null dereference issue when decl_specifiers.type is not yet provided. gcc/cp/ChangeLog: * parser.cc (cp_parser_parameter_declaration): Check if

Re: Updated Sourceware infrastructure plans

2024-04-22 Thread Jason Merrill via Gcc
On Mon, Apr 22, 2024 at 11:24 PM Tom Tromey wrote: > Jason> Someone mentioned earlier that gerrit was previously tried > Jason> unsuccessfully. > > We tried it and gdb and then abandoned it. We tried to integrate it > into the traditional gdb development style, having it send email to >

Re: [PATCH] c++: Check if allocation functions are xobj members [PR114078]

2024-04-22 Thread Jason Merrill
On 4/21/24 19:59, Patrick Palka wrote: On Sat, 20 Apr 2024, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- A class allocation member function is implicitly 'static' by [class.free] p3, so cannot have an explicit object parameter. PR

Re: [PATCH] c++, v2: Retry the aliasing of base/complete cdtor optimization at import_export_decl time [PR113208]

2024-04-22 Thread Jason Merrill
On 4/22/24 08:42, Jakub Jelinek wrote: On Wed, Apr 17, 2024 at 09:42:47AM +0200, Jakub Jelinek wrote: When expand_or_defer_fn is called at_eof time, it calls import_export_decl and then maybe_clone_body, which uses DECL_ONE_ONLY and comdat name in a couple of places to try to optimize cdtors

Re: [PATCH] c++: Copy over DECL_DISREGARD_INLINE_LIMITS flag to inheriting ctors [PR114784]

2024-04-22 Thread Jason Merrill
On 4/22/24 08:54, Jakub Jelinek wrote: Hi! The following testcase is rejected with error: inlining failed in call to 'always_inline' '...': call is unlikely and code size would grow errors. The problem is that starting with the r14-2149 change we try to copy most of the attributes from the

Re: [PATCH] c++: constexpr union member access folding [PR114709]

2024-04-22 Thread Jason Merrill
On 4/22/24 15:18, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/13/12? OK with a rationale comment. -- >8 -- The object/offset canonicalization performed in cxx_fold_indirect_ref is undesirable for union member accesses because it loses

Re: Updated Sourceware infrastructure plans

2024-04-22 Thread Jason Merrill via Gcc
On Mon, Apr 22, 2024 at 11:42 AM Tom Tromey wrote: > > "Frank" == Frank Ch Eigler writes: > > >> [...] I suggest that a basic principle for such a system is that it > >> should be *easy* to obtain and maintain a local copy of the history > >> of all pull requests. That includes all

Re: [PATCH v3] c++: ICE with temporary of class type in array DMI [PR109966]

2024-04-12 Thread Jason Merrill
On 3/14/24 17:26, Marek Polacek wrote: In the following patch, I'm taking a different tack. I believe we ought to use TARGET_EXPR_ELIDING_P. The gimplify_arg bit I'm talking about below is this: /* Also strip a TARGET_EXPR that would force an extra copy. */ if (TREE_CODE

Re: [PATCH] c++/modules: Setup aliases imported from modules [PR106820]

2024-04-12 Thread Jason Merrill
On 3/26/24 09:24, Nathaniel Shead wrote: I wonder if more generally we need to be doing more work when importing definitions from header units especially to handle all the work that 'make_rtl_for_nonlocal_decl' and 'rest_of_decl_compilation' would have been performing. Can we just call those

Re: [PATCH] c++: problematic assert in reference_binding [PR113141]

2024-04-12 Thread Jason Merrill
On 3/26/24 09:44, Patrick Palka wrote: On Thu, 7 Mar 2024, Jason Merrill wrote: On 1/29/24 17:42, Patrick Palka wrote: On Mon, 29 Jan 2024, Patrick Palka wrote: On Fri, 26 Jan 2024, Jason Merrill wrote: On 1/26/24 17:11, Jason Merrill wrote: On 1/26/24 16:52, Jason Merrill wrote: On 1

[gcc r14-9946] c++: reference list-init, conversion fn [PR113141]

2024-04-12 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:d435571b54b02946c97b5b24f20e5a7058fd96a1 commit r14-9946-gd435571b54b02946c97b5b24f20e5a7058fd96a1 Author: Jason Merrill Date: Fri Apr 12 13:24:44 2024 -0400 c++: reference list-init, conversion fn [PR113141] The original testcase in PR113141 is an instance

[pushed] c++: reference cast, conversion fn [PR113141]

2024-04-12 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- The second testcase in 113141 is a separate issue: we first decide that the conversion is ill-formed, but then when recalculating the special c_cast_p handling makes us think it's OK. We don't want that, it should continue to fall back to

[pushed] c++: reference list-init, conversion fn [PR113141]

2024-04-12 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- The original testcase in PR113141 is an instance of CWG1996; the standard fails to consider conversion functions when initializing a reference directly from an initializer-list of one element, but then does consider them when initializing a

Re: [PATCH] c++/modules: local class merging [PR99426]

2024-04-12 Thread Jason Merrill
On 4/12/24 14:39, Patrick Palka wrote: On Fri, 12 Apr 2024, Jason Merrill wrote: On 4/12/24 13:48, Patrick Palka wrote: On Fri, 12 Apr 2024, Jason Merrill wrote: On 4/12/24 10:35, Patrick Palka wrote: On Wed, 10 Apr 2024, Jason Merrill wrote: On 4/10/24 14:48, Patrick Palka wrote

Re: [PATCH] c++: Fix constexpr evaluation of parameters passed by invisible reference [PR111284]

2024-04-12 Thread Jason Merrill
On 3/8/24 03:56, Jakub Jelinek wrote: Hi! My r9-6136 changes to make a copy of constexpr function bodies before genericization modifies it broke the constant evaluation of non-POD arguments passed by value. In the callers such arguments are passed as reference to usually a TARGET_EXPR, but on

Re: [PATCH] c++: Fix bogus warnings about ignored annotations [PR114409]

2024-04-12 Thread Jason Merrill
On 3/22/24 04:08, Jakub Jelinek wrote: Hi! The middle-end warns about the ANNOTATE_EXPR added for while/for loops if they declare a var inside of the loop condition. This is because the assumption is that ANNOTATE_EXPR argument is used immediately in a COND_EXPR (later GIMPLE_COND), but

Re: [PATCH] c++/modules: local class merging [PR99426]

2024-04-12 Thread Jason Merrill
On 4/12/24 13:48, Patrick Palka wrote: On Fri, 12 Apr 2024, Jason Merrill wrote: On 4/12/24 10:35, Patrick Palka wrote: On Wed, 10 Apr 2024, Jason Merrill wrote: On 4/10/24 14:48, Patrick Palka wrote: On Tue, 9 Apr 2024, Jason Merrill wrote: On 3/5/24 10:31, Patrick Palka wrote: On Tue

Re: [PATCH 3/3] c++/modules: Propagate hidden flag on decls from partitions

2024-04-12 Thread Jason Merrill
On 4/11/24 20:41, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- While working on some other fixes I noticed that the partition handling code used the wrong flag to propagate OVL_HIDDEN_P on exported bindings from partitions. This patch

Re: [PATCH 2/3] c++/modules: Propagate using decls from partitions

2024-04-12 Thread Jason Merrill
On 4/11/24 20:40, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- The modules code currently neglects to set OVL_USING_P on the dependency created for a using-decl, which causes it not to remember that the OVL_EXPORT_P flag had been set on it

Re: [PATCH 1/3] c++/modules: Only emit exported GMF usings [PR114600]

2024-04-12 Thread Jason Merrill
On 4/11/24 20:40, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- A typo in r14-6978 made us emit too many things. This ensures that we don't emit using-declarations from the GMF that we don't need to. PR c++/114600

Re: [PATCH] c++: Diagnose or avoid constexpr dtors in classes with virtual bases [PR114426]

2024-04-12 Thread Jason Merrill
On 4/12/24 09:12, Jakub Jelinek wrote: Hi! I had another look at this P1 PR today. You said in the "c++: fix in-charge parm in constexpr" mail back in December (as well as in the r14-6507 commit message): "Since a class with vbases can't have constexpr 'tors there isn't actually a need for an

Re: [PATCH] c++: templated substitution into lambda-expr, cont [PR114393]

2024-04-12 Thread Jason Merrill
On 4/12/24 09:47, Patrick Palka wrote: The original PR114393 testcase is unfortunately still not accepted after r14-9938-g081c1e93d56d35 due to return type deduction confusion when a lambda-expr is used as a default template argument. The below reduced testcase demonstrates the bug. Here,

Re: [PATCH] c++/modules: local class merging [PR99426]

2024-04-12 Thread Jason Merrill
On 4/12/24 10:35, Patrick Palka wrote: On Wed, 10 Apr 2024, Jason Merrill wrote: On 4/10/24 14:48, Patrick Palka wrote: On Tue, 9 Apr 2024, Jason Merrill wrote: On 3/5/24 10:31, Patrick Palka wrote: On Tue, 27 Feb 2024, Patrick Palka wrote: Subject: [PATCH] c++/modules: local type merging

Re: [PATCH] c++: recalculating local specs via build_extra_args [PR114303]

2024-04-10 Thread Jason Merrill
On 4/10/24 20:00, Patrick Palka wrote: On Wed, 10 Apr 2024, Jason Merrill wrote: On 4/10/24 17:39, Patrick Palka wrote: On Wed, 10 Apr 2024, Jason Merrill wrote: On 3/12/24 10:51, Patrick Palka wrote: On Tue, 12 Mar 2024, Patrick Palka wrote: On Tue, 12 Mar 2024, Jason Merrill wrote

Re: [PATCH] c++/modules: local class merging [PR99426]

2024-04-10 Thread Jason Merrill
On 4/10/24 14:48, Patrick Palka wrote: On Tue, 9 Apr 2024, Jason Merrill wrote: On 3/5/24 10:31, Patrick Palka wrote: On Tue, 27 Feb 2024, Patrick Palka wrote: Subject: [PATCH] c++/modules: local type merging [PR99426] One known missing piece in the modules implementation is merging

Re: [PATCH] c++: recalculating local specs via build_extra_args [PR114303]

2024-04-10 Thread Jason Merrill
On 4/10/24 17:39, Patrick Palka wrote: On Wed, 10 Apr 2024, Jason Merrill wrote: On 3/12/24 10:51, Patrick Palka wrote: On Tue, 12 Mar 2024, Patrick Palka wrote: On Tue, 12 Mar 2024, Jason Merrill wrote: On 3/11/24 12:53, Patrick Palka wrote: r13-6452-g341e6cd8d603a3 made build_extra_args

Re: [PATCH] c++/114409 - ANNOTATE_EXPR and templates

2024-04-10 Thread Jason Merrill
On 4/10/24 13:10, Richard Biener wrote: On Wed, 10 Apr 2024, Jakub Jelinek wrote: On Wed, Apr 10, 2024 at 06:43:02PM +0200, Richard Biener wrote: The following fixes a mismatch in COMPOUND_EXPR handling in tsubst_expr vs tsubst_stmt where the latter allows a stmt in operand zero but the

Re: [PATCH] c++: Fix ANNOTATE_EXPR instantiation [PR114409]

2024-04-10 Thread Jason Merrill
On 4/10/24 09:06, Jakub Jelinek wrote: Hi! The following testcase ICEs starting with the r14-4229 PR111529 change which moved ANNOTATE_EXPR handling from tsubst_expr to tsubst_copy_and_build. ANNOTATE_EXPR is only allowed in the IL to wrap a loop condition, and the loop condition of while/for

Re: [PATCH] c++/modules: optimize tree flag streaming

2024-04-10 Thread Jason Merrill
On 4/10/24 11:26, Patrick Palka wrote: On Wed, 10 Apr 2024, Patrick Palka wrote: On Tue, 9 Apr 2024, Jason Merrill wrote: On 2/16/24 10:06, Patrick Palka wrote: On Thu, 15 Feb 2024, Patrick Palka wrote: One would expect consecutive calls to bytes_in/out::b for streaming adjacent bits

Re: [PATCH] c++: templated substitution into lambda-expr [PR114393]

2024-04-10 Thread Jason Merrill
On 3/27/24 10:01, Patrick Palka wrote: On Mon, 25 Mar 2024, Patrick Palka wrote: On Mon, 25 Mar 2024, Patrick Palka wrote: The below testcases use a lambda-expr as a template argument and they all trip over the below added tsubst_lambda_expr sanity check ultimately because

Re: [PATCH] c++: recalculating local specs via build_extra_args [PR114303]

2024-04-09 Thread Jason Merrill
On 3/12/24 10:51, Patrick Palka wrote: On Tue, 12 Mar 2024, Patrick Palka wrote: On Tue, 12 Mar 2024, Jason Merrill wrote: On 3/11/24 12:53, Patrick Palka wrote: r13-6452-g341e6cd8d603a3 made build_extra_args walk evaluated contexts first so that we prefer processing a local specialization

Re: [PATCH] c++/modules: optimize tree flag streaming

2024-04-09 Thread Jason Merrill
On 2/16/24 10:06, Patrick Palka wrote: On Thu, 15 Feb 2024, Patrick Palka wrote: One would expect consecutive calls to bytes_in/out::b for streaming adjacent bits, as we do for tree flag streaming, to at least be optimized by the compiler into individual bit operations using statically known

Re: [PATCH] c++/modules: local class merging [PR99426]

2024-04-09 Thread Jason Merrill
On 3/5/24 10:31, Patrick Palka wrote: On Tue, 27 Feb 2024, Patrick Palka wrote: Subject: [PATCH] c++/modules: local type merging [PR99426] One known missing piece in the modules implementation is merging of a streamed-in local type (class or enum) with the corresponding in-TU version of the

Re: [PATCH] c++, v3: Implement C++26 P2809R3 - Trivial infinite loops are not Undefined Behavior

2024-04-09 Thread Jason Merrill
On 4/9/24 05:57, Jakub Jelinek wrote: On Mon, Apr 08, 2024 at 06:53:29PM -0400, Jason Merrill wrote: + if (warn_tautological_compare) +{ + tree cond = *condp; + while (TREE_CODE (cond) == ANNOTATE_EXPR) + cond = TREE_OPERAND (cond, 0); + if (trivial_infinite

Re: [PATCH] c++: Keep DECL_SAVED_TREE of destructor instantiations in modules [PR104040]

2024-04-09 Thread Jason Merrill
On 4/9/24 09:36, Nathaniel Shead wrote: On Mon, Apr 08, 2024 at 11:17:27PM -0400, Jason Merrill wrote: On 4/4/24 07:27, Nathaniel Shead wrote: On Wed, Apr 03, 2024 at 11:18:01AM -0400, Jason Merrill wrote: On 4/2/24 20:57, Nathaniel Shead wrote: On Tue, Apr 02, 2024 at 01:18:17PM -0400

Re: [PATCH] c++: Keep DECL_SAVED_TREE of destructor instantiations in modules [PR104040]

2024-04-08 Thread Jason Merrill
On 4/4/24 07:27, Nathaniel Shead wrote: On Wed, Apr 03, 2024 at 11:18:01AM -0400, Jason Merrill wrote: On 4/2/24 20:57, Nathaniel Shead wrote: On Tue, Apr 02, 2024 at 01:18:17PM -0400, Jason Merrill wrote: On 3/28/24 23:21, Nathaniel Shead wrote: - && !(m

Re: [PATCH v2] c++/modules: Track declarations imported from partitions [PR99377]

2024-04-08 Thread Jason Merrill
On 4/4/24 08:27, Nathaniel Shead wrote: On Wed, Apr 03, 2024 at 02:16:25PM -0400, Jason Merrill wrote: On 3/28/24 08:22, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- The testcase in comment 15 of the linked PR is caused beca

Re: [PATCH] c++: Fix up maybe_warn_for_constant_evaluated calls [PR114580]

2024-04-08 Thread Jason Merrill
On 4/5/24 14:47, Marek Polacek wrote: On Fri, Apr 05, 2024 at 09:40:48AM +0200, Jakub Jelinek wrote: Hi! When looking at maybe_warn_for_constant_evaluated for the trivial infinite loops patch, I've noticed that it can emit weird diagnostics for if constexpr in templates, first warn that

Re: [PATCH] c++, v2: Implement C++26 P2809R3 - Trivial infinite loops are not Undefined Behavior

2024-04-08 Thread Jason Merrill
On 4/5/24 03:57, Jakub Jelinek wrote: Hi! Here is a new version of the PR114462 P2809R3 patch. As clarified on core, for trivially empty iteration statements (where the condition isn't empty or INTEGER_CST, because those loops can't contain std::is_constant_evaluated() in the condition and the

Re: [committed] c++: Fix ICE with weird copy assignment operator [PR114572]

2024-04-08 Thread Jason Merrill
On 4/5/24 03:35, Jakub Jelinek wrote: Hi! While ctors/dtors don't return anything (undeclared void or this pointer on arm) and copy assignment operators normally return a reference to *this, it isn't invalid to return uselessly some class object which might need destructing, but the OpenMP

Re: [PATCH v2] c++: constexpr error with fn redecl in local scope [PR111132]

2024-04-04 Thread Jason Merrill
On 4/4/24 19:15, Marek Polacek wrote: On Thu, Apr 04, 2024 at 05:28:22PM -0400, Jason Merrill wrote: On 4/4/24 14:43, Marek Polacek wrote: On Wed, Apr 03, 2024 at 01:14:46PM -0400, Jason Merrill wrote: On 4/2/24 13:52, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok

Re: [PATCH] c++: constexpr error with fn redecl in local scope [PR111132]

2024-04-04 Thread Jason Merrill
On 4/4/24 14:43, Marek Polacek wrote: On Wed, Apr 03, 2024 at 01:14:46PM -0400, Jason Merrill wrote: On 4/2/24 13:52, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13? -- >8 -- We evaluate constexpr functions on the original, pre-genericization bod

Re: [PATCH] c++: fix alias CTAD [PR114377]

2024-04-04 Thread Jason Merrill
Applied, thanks! BTW, in future please see https://gcc.gnu.org/contribute.html#legal This patch is small enough to not need to worry about copyright, but for larger patches we would. On 3/27/24 14:36, centurion wrote: PR c++/114377 gcc/cp/ChangeLog: PR c++/114377

[gcc r14-9795] c++: alias CTAD and template template parm [PR114377]

2024-04-04 Thread Jason Merrill via Gcc-cvs
instead of DECL_INITIAL. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/class-deduction-alias19.C: New test. Reviewed-by: Jason Merrill Diff: --- gcc/cp/pt.cc | 3 ++- gcc/testsuite/g++.dg/cpp2a/class-deduction-alias19.C | 15

Re: [PATCH] c++: Implement C++26 P2809R3 - Trivial infinite loops are not Undefined Behavior

2024-04-03 Thread Jason Merrill
On 4/3/24 15:16, Jakub Jelinek wrote: On Wed, Apr 03, 2024 at 12:58:12PM -0400, Jason Merrill wrote: On 4/3/24 12:42, Jakub Jelinek wrote: On Wed, Apr 03, 2024 at 12:07:48PM -0400, Jason Merrill wrote: Using std::is_constant_evaluated directly in a loop condition is, as the paper says

Re: [PATCH] c++/modules: Prefer partition indexes when installing imported entities [PR99377]

2024-04-03 Thread Jason Merrill
On 3/28/24 08:22, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- The testcase in comment 15 of the linked PR is caused because the following assumption in depset::hash::make_dependency doesn't hold: if (DECL_LANG_SPECIFIC (not_tmpl)

Re: [PATCH] c++: constexpr error with fn redecl in local scope [PR111132]

2024-04-03 Thread Jason Merrill
On 4/2/24 13:52, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13? -- >8 -- We evaluate constexpr functions on the original, pre-genericization bodies. That means that the function body we're evaluating will not have gone through cp_genericize_r's "Map block

Re: [PATCH] c++: Implement C++26 P2809R3 - Trivial infinite loops are not Undefined Behavior

2024-04-03 Thread Jason Merrill
On 4/3/24 12:42, Jakub Jelinek wrote: On Wed, Apr 03, 2024 at 12:07:48PM -0400, Jason Merrill wrote: Using std::is_constant_evaluated directly in a loop condition is, as the paper says, unlikely and "horrendous code", so I'm not concerned about surprising effects, though I guess we sh

Re: [PATCH] c++: Implement C++26 P2809R3 - Trivial infinite loops are not Undefined Behavior

2024-04-03 Thread Jason Merrill
On 4/3/24 03:25, Jakub Jelinek wrote: Hi! The following patch attempts to implement P2809R3, which has been voted in as a DR. The middle-end has its behavior documented: '-ffinite-loops' Assume that a loop with an exit will eventually take the exit and not loop indefinitely. This

Re: [PATCH] c++: Keep DECL_SAVED_TREE of destructor instantiations in modules [PR104040]

2024-04-03 Thread Jason Merrill
On 4/2/24 20:57, Nathaniel Shead wrote: On Tue, Apr 02, 2024 at 01:18:17PM -0400, Jason Merrill wrote: On 3/28/24 23:21, Nathaniel Shead wrote: - && !(modules_p () && DECL_DECLARED_INLINE_P (fn))) + && !(modules_p () + &&

Re: How to get the default values for parameters?

2024-04-03 Thread Jason Merrill via Gcc
On Wed, Apr 3, 2024 at 9:35 AM Hanke Zhang via Gcc wrote: > > Hi, > I'm trying to get the default values for parameters of some functions > in my GIMPLE-PASS. The example code is here: > > enum { > edefault1 = 1, > edefault2 = 2, > edefault3 = 3 > } > > void func(int p0, int p1 = edefault1,

Re: Patches submission policy change

2024-04-03 Thread Jason Merrill via Gcc
On Wed, Apr 3, 2024 at 6:23 AM Jan Beulich via Gcc wrote: > On 03.04.2024 10:57, Richard Biener wrote: > > On Wed, 3 Apr 2024, Jan Beulich wrote: > >> On 03.04.2024 10:45, Jakub Jelinek wrote: > >>> On Wed, Apr 03, 2024 at 10:22:24AM +0200, Christophe Lyon wrote: > Any concerns/objections?

[gcc r14-9757] c++: binding reference to comma expr [PR114561]

2024-04-02 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:5d7e9a35024f065b25f61747859c7cb7a770c92b commit r14-9757-g5d7e9a35024f065b25f61747859c7cb7a770c92b Author: Jason Merrill Date: Tue Apr 2 10:52:28 2024 -0400 c++: binding reference to comma expr [PR114561] We represent a reference binding where the referent

[pushed] c++: binding reference to comma expr [PR114561]

2024-04-02 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- We represent a reference binding where the referent type is more qualified by a ck_ref_bind around a ck_qual. We performed the ck_qual and then tried to undo it with STRIP_NOPS, but that doesn't work if the conversion is buried in

Re: [PATCH] c++: Keep DECL_SAVED_TREE of destructor instantiations in modules [PR104040]

2024-04-02 Thread Jason Merrill
On 3/28/24 23:21, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- A template instantiation still needs to have its DECL_SAVED_TREE so that its definition is emitted into the CMI. This way it can be emitted in the object file of any importers

Re: [PATCH] c++: ICE with scoped enum in switch condition [PR114451]

2024-04-02 Thread Jason Merrill
On 3/29/24 18:31, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13? OK. -- >8 -- Here we ICE when gimplifying enum class Type { Pawn }; struct Piece { Type type : 4; }; void foo() { switch (Piece().type) case Type::Pawn:; }

Re: [PATCH] c++: make __is_array return false for T[0] [PR114479]

2024-04-02 Thread Jason Merrill
On 4/1/24 13:50, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- When we switched to using the __is_array built-in trait to implement std::is_array in r14-6623-g7fd9c349e45534, we started saying that T[0] is an array. There are various opinions as to

gcc-wwwdocs branch master updated. 4f5550e76b8bd55d15479f9556bd25280e7244e0

2024-04-01 Thread Jason Merrill via Gcc-cvs-wwwdocs
--- commit 4f5550e76b8bd55d15479f9556bd25280e7244e0 Author: Jason Merrill Date: Mon Apr 1 12:07:05 2024 -0400 cxx-status: support p2748 diff --git a/htdocs/projects/cxx-status.html b/htdocs/projects/cxx-status.html index bfef2114..7897635c 100644 --- a/htdocs/projects/cxx-status.html +++ b/htdocs/projects/cxx-s

[gcc r14-9738] c++: C++26 returning reference to temporary

2024-04-01 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:bba118db3f63cb1e3953a014aa3ac2ad89908950 commit r14-9738-gbba118db3f63cb1e3953a014aa3ac2ad89908950 Author: Jason Merrill Date: Thu Mar 28 21:33:57 2024 -0400 c++: C++26 returning reference to temporary P2748R5 makes it ill-formed to return a reference

[pushed] c++: C++26 returning reference to temporary

2024-04-01 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- P2748R5 makes it ill-formed to return a reference to temporary in C++26; implementing this is a simple matter of changing the existing warning to a permerror. For most of the tests I just changed dg-warning to dg-message to accept both; I

[gcc r14-9713] c++: __is_constructible ref binding [PR100667]

2024-03-28 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:8bb3ef3f6e335e8794590fb712a2661d11d21973 commit r14-9713-g8bb3ef3f6e335e8794590fb712a2661d11d21973 Author: Jason Merrill Date: Wed Mar 27 16:14:01 2024 -0400 c++: __is_constructible ref binding [PR100667] The requirement that a type argument be complete

[PATCH] c++: __is_constructible ref binding [PR100667]

2024-03-28 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- The requirement that a type argument be complete is excessive in the case of direct reference binding to the same type, which does not rely on any properties of the type. This is LWG 2939. PR c++/100667 gcc/cp/ChangeLog:

Re: AutoFDO tools for GCC

2024-03-27 Thread Jason Merrill via Gcc
On Tue, Mar 26, 2024 at 6:41 PM Andi Kleen via Gcc wrote: > > On Tue, Mar 26, 2024 at 08:45:22AM +0100, Richard Biener wrote: > > On Mon, Mar 25, 2024 at 9:54 PM Eugene Rozenfeld via Gcc > > wrote: > > > > > > Hello, > > > > > > I've been the AutoFDO maintainer for the last 1.5 years. I've

Re: [PATCH] c++: broken direct-init with trailing array member [PR114439]

2024-03-25 Thread Jason Merrill
On 3/25/24 17:59, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? OK. -- >8 -- can_init_array_with_p is wrongly saying that the init for 's' here: struct S { int *list = arr; int arr[]; }; struct A { A() {} S s[2]{}; }; is

Re: [PATCH] c-family, c++: Handle EXCESS_PRECISION_EXPR in pretty printers

2024-03-25 Thread Jason Merrill
On 3/22/24 05:11, Jakub Jelinek wrote: Hi! I've noticed that the c-c++-common/gomp/depobj-3.c test FAILs on i686-linux: PASS: c-c++-common/gomp/depobj-3.c -std=c++17 at line 17 (test for warnings, line 15) FAIL: c-c++-common/gomp/depobj-3.c -std=c++17 at line 39 (test for warnings, line

Re: [PATCH v2] c++: ICE with noexcept and local specialization, again [PR114349]

2024-03-25 Thread Jason Merrill
On 3/22/24 17:30, Marek Polacek wrote: On Thu, Mar 21, 2024 at 05:27:37PM -0400, Jason Merrill wrote: On 3/21/24 17:01, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Patrick noticed that my r14-9339-gdc6c3bfb59baab patch is wrong; we're deal

Re: [PATCH v2] c++: direct-init of an array of class type [PR59465]

2024-03-21 Thread Jason Merrill
On 3/21/24 16:48, Marek Polacek wrote: On Wed, Mar 20, 2024 at 09:21:02PM -0400, Jason Merrill wrote: On 3/1/24 19:58, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? I don't claim that this has to go to 14 though. -- >8 -- ...from another array in a

Re: [PATCH] c++: ICE with noexcept and local specialization, again [PR114349]

2024-03-21 Thread Jason Merrill
On 3/21/24 17:01, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Patrick noticed that my r14-9339-gdc6c3bfb59baab patch is wrong; we're dealing with a noexcept-spec there, not a noexcept-expr, so setting cp_noexcept_operand et al is incorrect. Back

Re: [PATCH v2] c++: explicit inst of template method not generated [PR110323]

2024-03-20 Thread Jason Merrill
On 3/19/24 15:30, Marek Polacek wrote: On Mon, Mar 18, 2024 at 09:10:27PM -0400, Jason Merrill wrote: On 3/15/24 13:48, Marek Polacek wrote: On Thu, Mar 14, 2024 at 03:39:04PM -0400, Jason Merrill wrote: On 3/8/24 12:02, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok

Re: [PATCH] c++: direct-init of an array of class type [PR59465]

2024-03-20 Thread Jason Merrill
On 3/1/24 19:58, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? I don't claim that this has to go to 14 though. -- >8 -- ...from another array in a mem-initializer should not be accepted. We already reject struct string {} a[1]; string x[1](a); but

Re: [PATCH] c++: explicit inst of template method not generated [PR110323]

2024-03-18 Thread Jason Merrill
On 3/15/24 13:48, Marek Polacek wrote: On Thu, Mar 14, 2024 at 03:39:04PM -0400, Jason Merrill wrote: On 3/8/24 12:02, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Consider constexpr int VAL = 1; struct foo { templ

Re: [PATCH v3] c++: Fix handling of no-linkage decls for modules

2024-03-18 Thread Jason Merrill
On 3/16/24 07:23, Nathaniel Shead wrote: On Mon, Mar 11, 2024 at 02:13:34PM -0400, Jason Merrill wrote: On 3/8/24 18:18, Nathaniel Shead wrote: On Fri, Mar 08, 2024 at 10:19:52AM -0500, Jason Merrill wrote: On 3/7/24 21:55, Nathaniel Shead wrote: On Mon, Nov 27, 2023 at 03:59:39PM +1100

[gcc r14-9484] tree-core: clarify clobber comments

2024-03-14 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:efab8c1b692ab080bcee99a6ef7ba6ee43ed commit r14-9484-gefab8c1b692ab080bcee99a6ef7ba6ee43ed Author: Jason Merrill Date: Thu Feb 22 10:06:27 2024 + tree-core: clarify clobber comments It came up on the mailing list that OBJECT_BEGIN/END

[PATCH RFA] tree-core: clarify clobber comments

2024-03-14 Thread Jason Merrill
OK for trunk? -- 8< -- It came up on the mailing list that OBJECT_BEGIN/END are described as marking object lifetime, but mark the beginning of the constructor and end of the destructor, whereas the C++ notion of lifetime is between the end of the constructor and beginning of the destructor. So

Re: [PATCH] c++: explicit inst of template method not generated [PR110323]

2024-03-14 Thread Jason Merrill
On 3/8/24 12:02, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Consider constexpr int VAL = 1; struct foo { template void bar(typename std::conditional::type arg) { } }; template void foo::bar<1>(int arg); where we since

Re: [PATCH v2] c++: ICE with temporary of class type in array DMI [PR109966]

2024-03-12 Thread Jason Merrill
On 3/12/24 11:56, Marek Polacek wrote: On Tue, Mar 12, 2024 at 09:57:14AM -0400, Jason Merrill wrote: On 3/11/24 19:27, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13? -- >8 -- This ICE started with the fairly complicated r13-765. We cr

Re: [PATCH] c++: recalculating local specs via build_extra_args [PR114303]

2024-03-12 Thread Jason Merrill
On 3/11/24 12:53, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk and release branches? -- >8 -- r13-6452-g341e6cd8d603a3 made build_extra_args walk evaluated contexts first so that we prefer processing a local specialization in an evaluated

Re: [PATCH] c++: ICE with temporary of class type in array DMI [PR109966]

2024-03-12 Thread Jason Merrill
On 3/11/24 19:27, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13? -- >8 -- This ICE started with the fairly complicated r13-765. We crash in gimplify_var_or_parm_decl because a stray VAR_DECL leaked there. The problem is ultimately that

Re: [PATCH v2] c++: Support target-specific nodes with streaming [PR98645,PR111224]

2024-03-12 Thread Jason Merrill
On 3/12/24 08:21, Nathaniel Shead wrote: On Tue, Mar 12, 2024 at 11:11:40PM +1100, Nathaniel Shead wrote: On Mon, Mar 11, 2024 at 10:36:06AM -0400, Patrick Palka wrote: On Sun, 10 Mar 2024, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu and

Re: [PATCH v2] testsuite: xfail test for short_enums

2024-03-12 Thread Jason Merrill
On 3/11/24 06:23, Torbjörn SVENSSON wrote: Changes compared to v1: - Added reference to r14-6517-gb7e4a4c626e in dg-bogus comment - Changed arm-*-* to short_enums in target selector - Updated commit message to align with above changes As the entire block generating the warning was removed in

Re: [PATCH v2] c++: Check module attachment instead of just purview when necessary [PR112631]

2024-03-11 Thread Jason Merrill
On 3/8/24 18:18, Nathaniel Shead wrote: On Fri, Mar 08, 2024 at 10:19:52AM -0500, Jason Merrill wrote: On 3/7/24 21:55, Nathaniel Shead wrote: On Mon, Nov 27, 2023 at 03:59:39PM +1100, Nathaniel Shead wrote: On Thu, Nov 23, 2023 at 03:03:37PM -0500, Nathan Sidwell wrote: On 11/20/23 04:47

Re: [PATCH v2] c++: Check module attachment instead of just purview when necessary [PR112631]

2024-03-08 Thread Jason Merrill
On 3/7/24 21:55, Nathaniel Shead wrote: On Mon, Nov 27, 2023 at 03:59:39PM +1100, Nathaniel Shead wrote: On Thu, Nov 23, 2023 at 03:03:37PM -0500, Nathan Sidwell wrote: On 11/20/23 04:47, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu. I don't have write access. --

Re: [PATCH] c++: problematic assert in reference_binding [PR113141]

2024-03-07 Thread Jason Merrill
On 1/29/24 17:42, Patrick Palka wrote: On Mon, 29 Jan 2024, Patrick Palka wrote: On Fri, 26 Jan 2024, Jason Merrill wrote: On 1/26/24 17:11, Jason Merrill wrote: On 1/26/24 16:52, Jason Merrill wrote: On 1/25/24 14:18, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu

Re: [PATCH] c++/modules: member alias tmpl partial inst [PR103994]

2024-03-07 Thread Jason Merrill
On 3/7/24 14:41, Patrick Palka wrote: On Thu, 7 Mar 2024, Patrick Palka wrote: On Wed, 6 Mar 2024, Jason Merrill wrote: On 3/4/24 17:26, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Alias templates are we

Re: [PATCH] c++/modules: inline namespace abi_tag streaming [PR110730]

2024-03-07 Thread Jason Merrill
On 3/6/24 21:12, Patrick Palka wrote: On Wed, 6 Mar 2024, Jason Merrill wrote: On 3/6/24 14:10, Patrick Palka wrote: Tested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- The unreduced testcase from this PR crashes at runtime ultimately because we don't stream the abi_

Re: [PATCH v2] c++: Redetermine whether to write vtables on stream-in [PR114229]

2024-03-07 Thread Jason Merrill
On 3/7/24 07:49, Nathaniel Shead wrote: On Wed, Mar 06, 2024 at 08:59:16AM -0500, Jason Merrill wrote: On 3/5/24 22:06, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- Currently, reading a variable definition always marks that d

Re: [PATCH] c++: lambda capturing structured bindings [PR85889]

2024-03-06 Thread Jason Merrill
On 3/4/24 12:49, Marek Polacek wrote: On Fri, Mar 01, 2024 at 07:58:24PM -0500, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for 15? (Or even trunk?) -- >8 -- clarifies that it's OK to capture structured bindings.

Re: [PATCH] c++: ICE with variable template and [[deprecated]] [PR110031]

2024-03-06 Thread Jason Merrill
On 3/4/24 17:11, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/13? OK. -- >8 -- lookup_and_finish_template_variable already has and uses the complain parameter but it is not passing it down to mark_used so we got the default tf_warning_or_error, which

Re: [PATCH] c++/modules: member alias tmpl partial inst [PR103994]

2024-03-06 Thread Jason Merrill
On 3/4/24 17:26, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Alias templates are weird in that their specializations can appear in both decl_specializations and type_specializations. They appear in the latter only at parse time

Re: [PATCH] c++: Fix ICE diagnosing incomplete type of overloaded function set [PR98356]

2024-03-06 Thread Jason Merrill
On 3/4/24 18:30, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- In the linked PR the result of 'get_first_fn' is a USING_DECL against the template parameter, to be filled in on instantiation. But we don't actually need to get the first

Re: [PATCH] c++: Don't set DECL_CONTEXT to nested template-template parameters [PR98881]

2024-03-06 Thread Jason Merrill
* g++.dg/modules/tpl-tpl-parm-3.h: New test. * g++.dg/modules/tpl-tpl-parm-3_a.H: New test. * g++.dg/modules/tpl-tpl-parm-3_b.C: New test. * g++.dg/modules/tpl-tpl-parm-3_c.C: New test. Signed-off-by: Nathaniel Shead Reviewed-by: Patrick Palka Reviewed-b

  1   2   3   4   5   6   7   8   9   10   >