Re: [PATCH] c++: Fix parsing of abstract-declarator starting with ... followed by [ or ( [PR115012]

2024-05-24 Thread Jason Merrill
On 5/9/24 14:12, Jakub Jelinek wrote: The C++26 P2662R3 Pack indexing paper mentions that both GCC and MSVC don't handle T...[10] parameter declaration when T is a pack. While that will change meaning in C++26, in C++11 .. C++23 this ought to be valid. Sure, but I don't think it does anyone

Re: [PATCH] Add testcase for PR c++/105229: ICE in lookup_template_class_1

2024-05-24 Thread Jason Merrill
On 5/24/24 08:16, Simon Martin wrote: The test case in PR c++/105229 has been fixed since 11.4 (via PR c++/106024) - the attached patch simply adds the case to the test suite. Successfully tested on x86_64-pc-linux-gnu. OK for trunk? OK, thanks. BTW, the patch was corrupted by your mail

Re: [PATCH] c++/modules: Improve diagnostic when redeclaring builtin in module [PR102345]

2024-05-24 Thread Jason Merrill
On 5/24/24 11:32, Nathaniel Shead wrote: On Fri, May 24, 2024 at 11:24:38AM -0400, Jason Merrill wrote: On 5/24/24 11:20, Nathaniel Shead wrote: This is just a small improvement to a diagnostic. I thought about also adding an inform to suggest something like "standard library headers s

Re: [PATCH] c++/modules: Improve diagnostic when redeclaring builtin in module [PR102345]

2024-05-24 Thread Jason Merrill
On 5/24/24 11:20, Nathaniel Shead wrote: This is just a small improvement to a diagnostic. I thought about also adding an inform to suggest something like "standard library headers should be included in the GMF" or somesuch, but I'm not sure that'll be especially valuable and may be confusing

Re: [PATCH][14 backport] c++: Fix instantiation of imported temploid friends [PR114275]

2024-05-24 Thread Jason Merrill
On 5/24/24 10:40, Iain Sandoe wrote: On 24 May 2024, at 14:54, Jason Merrill wrote: On 5/24/24 04:06, Nathaniel Shead wrote: On Thu, May 23, 2024 at 06:41:06PM -0400, Jason Merrill wrote: On 5/13/24 07:56, Nathaniel Shead wrote: @@ -11751,9 +11767,16 @@ tsubst_friend_class (tree

Re: [PATCH] c++: extend -Wself-move for mem-init-list [PR109396]

2024-05-24 Thread Jason Merrill
On 5/23/24 19:57, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- We already warn for: x = std::move (x); which triggers: warning: moving 'x' of type 'int' to itself [-Wself-move] but bug 109396 reports that this doesn't work for a

Re: [PATCH v2] c++/modules: Improve errors for bad module-directives [PR115200]

2024-05-24 Thread Jason Merrill
On 5/23/24 19:58, Nathaniel Shead wrote: On Thu, May 23, 2024 at 05:11:39PM -0400, Jason Merrill wrote: On 5/23/24 10:54, Nathaniel Shead wrote: Bootstrapped and regtested (so far just modules.exp and dg.exp) on x86_64-pc-linux-gnu, OK for trunk if full regtest succeeds? -- >8 -- This fi

Re: [PATCH v2] c++: mark TARGET_EXPRs for function arguments eliding [PR114707]

2024-05-24 Thread Jason Merrill
On 5/23/24 20:32, Marek Polacek wrote: On Thu, May 23, 2024 at 04:04:13PM -0400, Jason Merrill wrote: On 5/23/24 10:41, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Coming back to our discussion in <https://gcc.gnu.org/pipermail/gcc-patche

Re: [PATCH 1/2] c++/modules: Fix treatment of unnamed types

2024-05-24 Thread Jason Merrill
On 5/23/24 21:27, Nathaniel Shead wrote: On Thu, May 23, 2024 at 03:36:48PM -0400, Jason Merrill wrote: On 5/23/24 09:27, Nathaniel Shead wrote: On Mon, May 20, 2024 at 06:00:09PM -0400, Jason Merrill wrote: On 5/17/24 02:14, Nathaniel Shead wrote: On Tue, May 14, 2024 at 06:21:48PM -0400

Re: [PATCH][14 backport] c++: Fix instantiation of imported temploid friends [PR114275]

2024-05-24 Thread Jason Merrill
On 5/24/24 04:06, Nathaniel Shead wrote: On Thu, May 23, 2024 at 06:41:06PM -0400, Jason Merrill wrote: On 5/13/24 07:56, Nathaniel Shead wrote: @@ -11751,9 +11767,16 @@ tsubst_friend_class (tree friend_tmpl, tree args) if (tmpl != error_mark_node) { /* The new TMPL

PING Re: PING Re: [PATCH RFA (cgraph)] c++: pragma target and static init [PR109753]

2024-05-23 Thread Jason Merrill
Ping On 5/14/24 17:21, Jason Merrill wrote: Ping On 5/2/24 09:54, Jason Merrill wrote: Tested x86_64-pc-linux-gnu, OK for trunk?  14.2? This two-year-old thread seems relevant: https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593410.html -- 8< --   #pragma target and optimize sho

Re: [PATCH][14 backport] c++: Fix instantiation of imported temploid friends [PR114275]

2024-05-23 Thread Jason Merrill
On 5/13/24 07:56, Nathaniel Shead wrote: @@ -11751,9 +11767,16 @@ tsubst_friend_class (tree friend_tmpl, tree args) if (tmpl != error_mark_node) { /* The new TMPL is not an instantiation of anything, so we -forget its origins. We don't reset

Re: [PATCH] c++: alias CTAD and copy deduction guide [PR115198]

2024-05-23 Thread Jason Merrill
On 5/23/24 17:42, Patrick Palka wrote: On Thu, 23 May 2024, Jason Merrill wrote: On 5/23/24 14:06, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? -- >8 -- Here we're neglecting to update DECL_NAME during the alias CTAD gu

Re: [PATCH] c++: alias CTAD and copy deduction guide [PR115198]

2024-05-23 Thread Jason Merrill
On 5/23/24 14:06, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? -- >8 -- Here we're neglecting to update DECL_NAME during the alias CTAD guide transformation, which causes copy_guide_p to return false for the transformed copy deduction

Re: [PATCH] c++/modules: Improve errors for bad module-directives [PR115200]

2024-05-23 Thread Jason Merrill
On 5/23/24 10:54, Nathaniel Shead wrote: Bootstrapped and regtested (so far just modules.exp and dg.exp) on x86_64-pc-linux-gnu, OK for trunk if full regtest succeeds? -- >8 -- This fixes an ICE when a module directive is not given at global scope. Although not explicitly mentioned, it seems

[pushed] c++: deleting array temporary [PR115187]

2024-05-23 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- Decaying the array temporary to a pointer and then deleting that crashes in verify_gimple_stmt, because the TARGET_EXPR is first evaluated inside the TRY_FINALLY_EXPR, but the cleanup point is outside. Fixed by using get_target_expr

Re: [PATCH] c++: mark TARGET_EXPRs for function arguments eliding [PR114707]

2024-05-23 Thread Jason Merrill
On 5/23/24 10:41, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Coming back to our discussion in : TARGET_EXPRs that initialize a function argument are not marked TARGET_EXPR_ELIDING_P

Re: [PATCH] c++/modules: Ensure all partial specialisations are tracked [PR114947]

2024-05-23 Thread Jason Merrill
On 5/12/24 09:29, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- Constrained partial specialisations aren't all necessarily tracked on the instantiation table. The modules code uses a separate 'partial_specializations' table to track them

Re: [PATCH 2/2] c++/modules: Remember that header units have CMIs

2024-05-23 Thread Jason Merrill
On 5/23/24 09:29, Nathaniel Shead wrote: And here's that patch. As far as I can tell there should be no visible change anymore, so there aren't any testcases. Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- This appears to be an oversight in the definition of

Re: [PATCH 1/2] c++/modules: Fix treatment of unnamed types

2024-05-23 Thread Jason Merrill
On 5/23/24 09:27, Nathaniel Shead wrote: On Mon, May 20, 2024 at 06:00:09PM -0400, Jason Merrill wrote: On 5/17/24 02:14, Nathaniel Shead wrote: On Tue, May 14, 2024 at 06:21:48PM -0400, Jason Merrill wrote: On 5/12/24 22:58, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc

Re: [PATCH v4] c++: fix constained auto deduction in templ spec scopes [PR114915]

2024-05-22 Thread Jason Merrill
OK, on the right patch this time I hope. Looks like you still need either FSF copyright assignment or DCO certification per https://gcc.gnu.org/contribute.html#legal On 5/15/24 13:27, Seyed Sajad Kahani wrote: This patch resolves PR114915 by replacing the logic that fills in the missing

Re: [PATCH] Fix auto deduction for template specialization scopes [114915].

2024-05-22 Thread Jason Merrill
On 5/22/24 12:48, Patrick Palka wrote: On Wed, 22 May 2024, Jason Merrill wrote: Thanks for the patch! Please review https://gcc.gnu.org/contribute.html for more details of the format patches should have. In particular, you don't seem to have a copyright assignment on file with the FSF, so

Re: [PATCH] Fix auto deduction for template specialization scopes [114915].

2024-05-22 Thread Jason Merrill
Thanks for the patch! Please review https://gcc.gnu.org/contribute.html for more details of the format patches should have. In particular, you don't seem to have a copyright assignment on file with the FSF, so you'll need to either do that or certify that the contribution is under the DCO.

[PATCH RFC] c++: add module extensions

2024-05-22 Thread Jason Merrill
Tested x86_64-pc-linux-gnu. Any thoughts about the mkdeps output? -- 8< -- There is a trend in the broader C++ community to use a different extension for module interface units, even though they are compiled in the same way as other source files. Let's also support these extensions. .ixx is

Re: [PATCH] c++: canonicity of fn types w/ complex eh specs [PR115159]

2024-05-22 Thread Jason Merrill
On 5/22/24 09:01, Patrick Palka wrote: On Tue, 21 May 2024, Jason Merrill wrote: On 5/21/24 21:55, Patrick Palka wrote: On Tue, 21 May 2024, Jason Merrill wrote: On 5/21/24 17:27, Patrick Palka wrote: On Tue, 21 May 2024, Jason Merrill wrote: On 5/21/24 15:36, Patrick Palka wrote

Re: [PATCH] c++: canonicity of fn types w/ complex eh specs [PR115159]

2024-05-21 Thread Jason Merrill
On 5/21/24 21:55, Patrick Palka wrote: On Tue, 21 May 2024, Jason Merrill wrote: On 5/21/24 17:27, Patrick Palka wrote: On Tue, 21 May 2024, Jason Merrill wrote: On 5/21/24 15:36, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk

Re: [PATCH] c++: canonicity of fn types w/ complex eh specs [PR115159]

2024-05-21 Thread Jason Merrill
On 5/21/24 17:27, Patrick Palka wrote: On Tue, 21 May 2024, Jason Merrill wrote: On 5/21/24 15:36, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? Alternatively, I considered fixing this by incrementing comparing_specializations around

Re: [PATCH] c++: canonicity of fn types w/ complex eh specs [PR115159]

2024-05-21 Thread Jason Merrill
On 5/21/24 15:36, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? Alternatively, I considered fixing this by incrementing comparing_specializations around the call to comp_except_specs in cp_check_qualified_type, but generally for types whose

Re: [PATCH] c++: folding non-dep enumerator from current inst [PR115139]

2024-05-21 Thread Jason Merrill
On 5/17/24 12:05, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? OK for both. -- >8 -- After the tsubst_copy removal r14-4796-g3e3d73ed5e85e7 GCC 14 ICEs during fold_non_dependent_expr for 'e1 | e2' ultimately because we no longer

Re: [PATCH] testsuite: Allow for non-SECTION_MERGE systems in gcc.dg/pr115066.c [PR115066]

2024-05-21 Thread Jason Merrill
On 5/21/24 07:36, Rainer Orth wrote: gcc.dg/pr115066.c currently FAILs on Solaris/SPARC with the native as: FAIL: gcc.dg/pr115066.c scan-assembler .bytet0xbt# Define macro strx Instead of the expected .byte 0xb ! Define macro strx the assembler output contains

Re: [PATCH v5 2/5] C++: Support clang compatible [[musttail]] (PR83324)

2024-05-21 Thread Jason Merrill
On 5/14/24 19:23, Andi Kleen wrote: You need a template testcase; I expect it doesn't work in templates with the current patch. It's probably enough to copy it in tsubst_expr where we currently propagate CALL_EXPR_OPERATOR_SYNTAX. I tried it with the appended test case, everything seems to

Re: [PATCH v2] c++: Strengthen checks on 'main'

2024-05-20 Thread Jason Merrill
On 5/17/24 02:47, Nathaniel Shead wrote: On Tue, May 14, 2024 at 06:25:29PM -0400, Jason Merrill wrote: On 5/11/24 08:32, Nathaniel Shead wrote: I wasn't entirely sure what to do with the 'abi/main.C' testcase here; is this OK, or should I e.g. lower the linkage error to a pedwarn

Re: [PATCH v2] c++/modules: Remember that header units have CMIs

2024-05-20 Thread Jason Merrill
On 5/17/24 02:14, Nathaniel Shead wrote: On Tue, May 14, 2024 at 06:21:48PM -0400, Jason Merrill wrote: On 5/12/24 22:58, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. I realised as I was looking over this again that I might have spoken too

Re: [PATCH] c++: paren aggr CTAD with base classes [PR115114]

2024-05-16 Thread Jason Merrill
On 5/16/24 11:32, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps 14? OK for both. -- >8 -- We're accidentally ignoring base classes during parenthesized aggregate CTAD because the TYPE_FIELDS of a template type doesn't contain

Re: [PATCH] c++: represent all class non-dep assignments as CALL_EXPR

2024-05-16 Thread Jason Merrill
On 5/15/24 13:55, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linu-xgnu, does this look OK for trunk? OK. -- >8 -- Non-dependent compound assignment expressions are currently represented as CALL_EXPR to the selected operator@= overload. Non-dependent simple assignments on

Re: [PATCH] c++: lvalueness of non-dependent assignment [PR114994]

2024-05-14 Thread Jason Merrill
On 5/11/24 20:46, Patrick Palka wrote: On Fri, 10 May 2024, Jason Merrill wrote: On 5/9/24 16:23, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? For trunk as a follow-up I can implement the mentionted representation change to use

Re: [PATCH] c++: Strengthen checks on 'main'

2024-05-14 Thread Jason Merrill
On 5/11/24 08:32, Nathaniel Shead wrote: I wasn't entirely sure what to do with the 'abi/main.C' testcase here; is this OK, or should I e.g. lower the linkage error to a pedwarn for the purposes of this test? I think it should be a pedwarn anyway, since it's harmless. The others can still be

Re: [PATCH] c++/modules: Remember that header units have CMIs

2024-05-14 Thread Jason Merrill
On 5/12/24 22:58, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- This appears to be an oversight in the definition of module_has_cmi_p; this comes up transitively in other functions used for e.g. determining whether a name could

Re: [PATCH] c++: Optimize in maybe_clone_body aliases even when not at_eof [PR113208]

2024-05-14 Thread Jason Merrill
On 5/13/24 06:19, Jakub Jelinek wrote: On Fri, May 10, 2024 at 03:59:25PM -0400, Jason Merrill wrote: 2024-05-09 Jakub Jelinek Jason Merrill PR lto/113208 * cp-tree.h (maybe_optimize_cdtor): Remove. * decl2.cc (tentative_decl_linkage): Call

Re: [PATCH] testsuite: c++: Allow for std::printf in g++.dg/modules/stdio-1_a.H [PR98529]

2024-05-14 Thread Jason Merrill
On 5/13/24 08:10, Rainer Orth wrote: Hi Nathaniel, There are a couple of other tests that appear to potentially have a similar issue: global-2_a.C 21:// { dg-final { scan-lang-dump-not {Reachable GMF '::printf[^\n']*' added} module } } global-3_a.C 15:// { dg-final { scan-lang-dump-not

Re: [PATCH v2] c++: ICE with reference NSDMI [PR114854]

2024-05-14 Thread Jason Merrill
On 5/14/24 09:48, Marek Polacek wrote: On Thu, May 09, 2024 at 03:47:54PM -0400, Jason Merrill wrote: On 5/9/24 12:04, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Here we crash on a cp_gimplify_expr/TARGET_EXPR assert: /* A TARGET_E

Re: [PATCH v2] c++: DR 569, DR 1693: fun with semicolons [PR113760]

2024-05-14 Thread Jason Merrill
On 5/14/24 12:55, Marek Polacek wrote: On Thu, May 09, 2024 at 12:44:52PM -0400, Jason Merrill wrote: On 5/9/24 12:16, Marek Polacek wrote: +static void +maybe_warn_extra_semi (location_t loc, extra_semi_kind kind) +{ + /* -Wno-extra-semi suppresses all. */ + if (warn_extra_semi == 0

Re: [PATCH v5 2/5] C++: Support clang compatible [[musttail]] (PR83324)

2024-05-14 Thread Jason Merrill
On 5/14/24 13:24, Andi Kleen wrote: Hi Jason, On Mon, May 06, 2024 at 11:02:20PM -0400, Jason Merrill wrote: @@ -30189,7 +30207,7 @@ cp_parser_std_attribute (cp_parser *parser, tree attr_ns) /* Maybe we don't expect to see any arguments for this attribute. */ const

Re: [PATCH] c++: add test for DR 2855

2024-05-14 Thread Jason Merrill
On 5/14/24 13:54, Marek Polacek wrote: Tested x86_64-pc-linux-gnu, OK to add such a test? OK. -- >8 -- Let int8_t x = 127; This DR says that while x++; invokes UB, ++x; does not. The resolution was to make the first one valid. The following test verifies that we don't report

PING Re: [PATCH RFA (cgraph)] c++: pragma target and static init [PR109753]

2024-05-14 Thread Jason Merrill
Ping On 5/2/24 09:54, Jason Merrill wrote: Tested x86_64-pc-linux-gnu, OK for trunk? 14.2? This two-year-old thread seems relevant: https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593410.html -- 8< -- #pragma target and optimize should also apply to implicitly-generated functi

Re: [PATCH v25 20/23] c++: Implement __is_invocable built-in trait

2024-05-10 Thread Jason Merrill
On 5/10/24 12:14, Ken Matsui wrote: Removed the redundant check and fixed the flow. Could you please review this again? Looks good! All the compiler trait patches are OK. -- >8 -- This patch implements built-in trait for std::is_invocable. gcc/cp/ChangeLog: * cp-trait.def:

Re: [PATCH] c++: Optimize in maybe_clone_body aliases even when not at_eof [PR113208]

2024-05-10 Thread Jason Merrill
On 5/9/24 14:20, Jakub Jelinek wrote: On Thu, Apr 25, 2024 at 11:30:48AM -0400, Jason Merrill wrote: Hmm, maybe maybe_clone_body shouldn't clear DECL_SAVED_TREE for aliases, but rather set it to some stub like void_node? Though with all these changes, it's probably better to go with your first

Re: [PATCH] c++: lvalueness of non-dependent assignment [PR114994]

2024-05-10 Thread Jason Merrill
On 5/9/24 16:29, Patrick Palka wrote: On Thu, 9 May 2024, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? For trunk as a follow-up I can implement the mentionted representation change to use CALL_EXPR instead of MODOP_EXPR for a

Re: [PATCH] c++: lvalueness of non-dependent assignment [PR114994]

2024-05-10 Thread Jason Merrill
On 5/9/24 16:23, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? For trunk as a follow-up I can implement the mentionted representation change to use CALL_EXPR instead of MODOP_EXPR for a non-dependent simple assignment expression that

Re: [PATCH v24 20/23] c++: Implement __is_invocable built-in trait

2024-05-10 Thread Jason Merrill
On 5/10/24 10:45, Ken Matsui wrote: Fixed the incorrect if condition. Could you please review this again? -- >8 -- This patch implements built-in trait for std::is_invocable. gcc/cp/ChangeLog: * cp-trait.def: Define __is_invocable. * constraint.cc (diagnose_trait_expr):

Re: [PATCH v23 20/23] c++: Implement __is_invocable built-in trait

2024-05-10 Thread Jason Merrill
On 5/10/24 07:24, Ken Matsui wrote: Fixed the reference to pointer to class case. Ok for trunk? -- >8 -- This patch implements built-in trait for std::is_invocable. gcc/cp/ChangeLog: * cp-trait.def: Define __is_invocable. * constraint.cc (diagnose_trait_expr): Handle

Re: [PATCH] c++, mingw, v2: Fix up types of dtor hooks to __cxa_{,thread_}atexit/__cxa_throw on mingw ia32 [PR114968]

2024-05-09 Thread Jason Merrill
On 5/9/24 14:46, Jakub Jelinek wrote: On Thu, May 09, 2024 at 01:05:59PM -0400, Jason Merrill wrote: I think I'd rather pass ob_parm to start_cleanup_fn, where it can also replace the flag_use_cxa_atexit check in that function. Good idea, changed in the following patch. @@ -9998,7 +10004,8

Re: [PATCH v2] c++: failure to suppress -Wsizeof-array-div in template [PR114983]

2024-05-09 Thread Jason Merrill
On 5/9/24 15:28, Marek Polacek wrote: On Thu, May 09, 2024 at 12:51:28PM -0400, Jason Merrill wrote: On 5/9/24 12:03, Marek Polacek wrote: diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index 8787eabb9fd..46cf8a737fb 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -20569,6 +20569,7 @@ tsubst_expr

Re: [PATCH] c++: ICE with reference NSDMI [PR114854]

2024-05-09 Thread Jason Merrill
On 5/9/24 12:04, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Here we crash on a cp_gimplify_expr/TARGET_EXPR assert: /* A TARGET_EXPR that expresses direct-initialization should have been elided by cp_gimplify_init_expr. */

Re: [PATCH] c++: nested aggregate/alias CTAD fixes

2024-05-09 Thread Jason Merrill
On 5/8/24 13:49, Patrick Palka wrote: Bootstrapped and regtested on x86-64-pc-linux-gnu, does this look OK for trunk and perhaps 14? OK for both. -- >8 -- During maybe_aggr_guide with a nested class template and paren init, like with list init we need to consider the generic template type

Re: [PATCH] c++, mingw: Fix up types of dtor hooks to __cxa_{,thread_}atexit/__cxa_throw on mingw ia32 [PR114968]

2024-05-09 Thread Jason Merrill
On 5/9/24 05:01, Jakub Jelinek wrote: Hi! __cxa_atexit/__cxa_thread_atexit/__cxa_throw functions accept function pointers to usually directly destructors rather than wrappers around them. Now, mingw ia32 uses implicitly __attribute__((thiscall)) calling conventions for METHOD_TYPE (where the

Re: [PATCH] c++: failure to suppress -Wsizeof-array-div in template [PR114983]

2024-05-09 Thread Jason Merrill
On 5/9/24 12:03, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- -Wsizeof-array-div offers a way to suppress the warning by wrapping the second operand of the division in parens: sizeof (samplesBuffer) / (sizeof(unsigned char)) but this doesn't

Re: [PATCH] c++: DR 569, DR 1693: fun with semicolons [PR113760]

2024-05-09 Thread Jason Merrill
On 5/9/24 12:16, Marek Polacek wrote: In GCC 14, I submitted a minimal fix for the "extra ; warning", pushed in r14-8967. That patch mentions a more complete patch for GCC 15. This is the patch. Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- Prompted by c++/113760, I

Re: [PATCH v22 20/23] c++: Implement __is_invocable built-in trait

2024-05-09 Thread Jason Merrill
On 5/8/24 01:04, Ken Matsui wrote: Fixed the reference_wrapper case. I used non_ref_datum_type to avoid potentially multiple build_trait_object calls. -- >8 -- This patch implements built-in trait for std::is_invocable. gcc/cp/ChangeLog: * cp-trait.def: Define __is_invocable.

Re: [PATCH] c++: Implement C++26 P2893R3 - Variadic friends [PR114459]

2024-05-07 Thread Jason Merrill
On 5/3/24 12:35, Jakub Jelinek wrote: Hi! The following patch imeplements the C++26 P2893R3 - Variadic friends paper. The paper allows for the friend type declarations to specify more than one friend type specifier and allows to specify ... at the end of each. The patch doesn't introduce

Re: [PATCH] c++/modules: Stream unmergeable temporaries by value again [PR114856]

2024-05-07 Thread Jason Merrill
On 5/7/24 01:35, Nathaniel Shead wrote: On Thu, May 02, 2024 at 01:53:44PM -0400, Jason Merrill wrote: On 5/2/24 10:40, Patrick Palka wrote: On Thu, 2 May 2024, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/14.2? Another alternative would

Re: [PATCH v21 20/23] c++: Implement __is_invocable built-in trait

2024-05-07 Thread Jason Merrill
On 5/3/24 16:52, Ken Matsui wrote: Fixed datum reference problem. Ok for trunk? -- >8 -- This patch implements built-in trait for std::is_invocable. gcc/cp/ChangeLog: * cp-trait.def: Define __is_invocable. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_INVOCABLE.

Re: [PATCH v5 2/5] C++: Support clang compatible [[musttail]] (PR83324)

2024-05-06 Thread Jason Merrill
On 5/5/24 14:14, Andi Kleen wrote: This patch implements a clang compatible [[musttail]] attribute for returns. Thanks. musttail is useful as an alternative to computed goto for interpreters. With computed goto the interpreter function usually ends up very big which causes problems with

Re: [PATCH v3] c++/modules: Fix dangling pointer with imported_temploid_friends

2024-05-06 Thread Jason Merrill
On 5/6/24 18:53, Patrick Palka wrote: On Mon, 6 May 2024, Jason Merrill wrote: On 5/3/24 07:17, Nathaniel Shead wrote: On Thu, May 02, 2024 at 02:05:38PM -0400, Jason Merrill wrote: On 5/1/24 21:34, Nathaniel Shead wrote: On Thu, May 02, 2024 at 12:15:44AM +1000, Nathaniel Shead wrote

Re: [PATCH] c++: replace tf_norm with a local flag

2024-05-06 Thread Jason Merrill
On 5/3/24 11:26, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? OK. -- >8 -- The tf_norm flag controlling whether to build diagnostic information during constraint normalization doesn't need to be a global tsubst flag, and is confusingly

Re: [PATCH v3] c++/modules: Fix dangling pointer with imported_temploid_friends

2024-05-06 Thread Jason Merrill
On 5/3/24 07:17, Nathaniel Shead wrote: On Thu, May 02, 2024 at 02:05:38PM -0400, Jason Merrill wrote: On 5/1/24 21:34, Nathaniel Shead wrote: On Thu, May 02, 2024 at 12:15:44AM +1000, Nathaniel Shead wrote: On Wed, May 01, 2024 at 09:57:38AM -0400, Patrick Palka wrote: On Wed, 1 May 2024

Re: [PATCH] c++: Allow IS_FAKE_BASE_TYPE for union types [PR114954]

2024-05-06 Thread Jason Merrill
On 5/6/24 02:32, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- In some circumstances, unions can also have an __as_base type; Hmm, even though unions can't be bases I guess that is needed for something like union U { int i; private:

Re: [PATCH] Fix PR c++/105760: ICE in build_deduction_guide for invalid template

2024-05-06 Thread Jason Merrill
+   * pt.c (build_deduction_guide): Check for error_mark_node +   result from tsubst_arg_types. +  2024-05-03  Jason Merrill      PR c++/114935 diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc index d68d688016d..da5d9b8a665 100644 --- a/gcc/cp/pt.cc +++ b/gcc/cp/pt.cc @@ -30018,6 +30018,8

Re: [PATCH] contrib/gcc-changelog/git_check_commit.py: Implement --num-commits

2024-05-06 Thread Jason Merrill
On 5/6/24 09:25, Ken Matsui wrote: On Thu, Mar 14, 2024 at 12:57 AM Ken Matsui wrote: On Fri, Mar 8, 2024 at 8:42 AM Patrick Palka wrote: On Wed, 28 Feb 2024, Ken Matsui wrote: This patch implements a --num-commits (-n) flag for shorthand for the range of hash~N..hash commits. Ping.

[pushed] c++: initializer_list and EH [PR114935]

2024-05-03 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk and 14. -- 8< -- When we initialize an array of a type with a non-trivial destructor, such as the backing array for the initializer_list, we have a cleanup to destroy any constructed elements if a later constructor throws. When the array being

Re: [PATCH v20 23/26] c++: Implement __is_invocable built-in trait

2024-05-03 Thread Jason Merrill
On 5/2/24 23:25, Ken Matsui wrote: Addressed Jason's review comments. Ok for trunk? -- >8 -- This patch implements built-in trait for std::is_invocable. gcc/cp/ChangeLog: * cp-trait.def: Define __is_invocable. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_INVOCABLE.

Re: [PATCH v18 23/26] c++: Implement __is_invocable built-in trait

2024-05-02 Thread Jason Merrill
On 5/2/24 16:47, Ken Matsui wrote: On Thu, May 2, 2024 at 1:38 PM Jason Merrill wrote: On 5/2/24 16:12, Ken Matsui wrote: This patch implements built-in trait for std::is_invocable. gcc/cp/ChangeLog: * cp-trait.def: Define __is_invocable. * constraint.cc (diagnose_trait_expr

Re: [PATCH v19 23/26] c++: Implement __is_invocable built-in trait

2024-05-02 Thread Jason Merrill
On 5/2/24 22:09, Ken Matsui wrote: This patch implements built-in trait for std::is_invocable. Looks like this doesn't address my review comments on v18, only Marek's? gcc/cp/ChangeLog: * cp-trait.def: Define __is_invocable. * constraint.cc (diagnose_trait_expr): Handle

Re: [PATCH v18 23/26] c++: Implement __is_invocable built-in trait

2024-05-02 Thread Jason Merrill
On 5/2/24 16:12, Ken Matsui wrote: This patch implements built-in trait for std::is_invocable. gcc/cp/ChangeLog: * cp-trait.def: Define __is_invocable. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_INVOCABLE. * semantics.cc (trait_expr_value): Likewise.

Re: [PATCH v17 05/26] c++: Implement __is_pointer built-in trait

2024-05-02 Thread Jason Merrill
On 5/2/24 14:42, Ken Matsui wrote: This patch implements built-in trait for std::is_pointer. OK. gcc/cp/ChangeLog: * cp-trait.def: Define __is_pointer. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_POINTER. * semantics.cc (trait_expr_value): Likewise.

Re: [PATCH v17 01/26] c++: Implement __is_const built-in trait

2024-05-02 Thread Jason Merrill
On 5/2/24 14:42, Ken Matsui wrote: This patch implements built-in trait for std::is_const. OK. gcc/cp/ChangeLog: * cp-trait.def: Define __is_const. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_CONST. * semantics.cc (trait_expr_value): Likewise.

Re: [PATCH v17 03/26] c++: Implement __is_volatile built-in trait

2024-05-02 Thread Jason Merrill
On 5/2/24 14:42, Ken Matsui wrote: This patch implements built-in trait for std::is_volatile. OK. gcc/cp/ChangeLog: * cp-trait.def: Define __is_volatile. * constraint.cc (diagnose_trait_expr): Handle CPTK_IS_VOLATILE. * semantics.cc (trait_expr_value): Likewise.

Re: Trait built-in naming convention

2024-05-02 Thread Jason Merrill
On 5/2/24 15:36, Iain Sandoe wrote: On 2 May 2024, at 20:30, Ken Matsui wrote: On Thu, May 2, 2024 at 10:54 AM Marek Polacek wrote: On Thu, May 02, 2024 at 08:37:53PM +0300, Ville Voutilainen wrote: On Thu, 2 May 2024 at 20:25, Ken Matsui wrote: There was some discussion of how to

Re: [PATCH 2/2] c++: remove lookup_template_class's entering_scope flag

2024-05-02 Thread Jason Merrill
On 5/2/24 13:49, Patrick Palka wrote: On Wed, 1 May 2024, Jason Merrill wrote: On 5/1/24 13:40, Patrick Palka wrote: On Wed, 1 May 2024, Jason Merrill wrote: On 5/1/24 12:41, Patrick Palka wrote: On Fri, 2 Feb 2024, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux, does

Re: [PATCH v2] c++/modules: Fix dangling pointer with imported_temploid_friends

2024-05-02 Thread Jason Merrill
On 5/1/24 21:34, Nathaniel Shead wrote: On Thu, May 02, 2024 at 12:15:44AM +1000, Nathaniel Shead wrote: On Wed, May 01, 2024 at 09:57:38AM -0400, Patrick Palka wrote: On Wed, 1 May 2024, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk (and later

Re: [PATCH] c++/modules: Stream unmergeable temporaries by value again [PR114856]

2024-05-02 Thread Jason Merrill
On 5/2/24 10:40, Patrick Palka wrote: On Thu, 2 May 2024, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/14.2? Another alternative would be to stream such !DECL_NAME temporaries with a merge key of MK_unique rather than attempting to find the matching

Trait built-in naming convention

2024-05-02 Thread Jason Merrill
On 5/2/24 12:45, Jason Merrill wrote: On 5/2/24 12:20, Ken Matsui wrote: On Thu, May 2, 2024 at 8:34 AM Ken Matsui wrote: On Thu, May 2, 2024 at 8:16 AM Patrick Palka wrote: On Tue, 30 Apr 2024, Jason Merrill wrote: On 2/28/24 11:26, Ken Matsui wrote: This patch implements built

Re: [PATCH v14 21/26] c++: Implement __rank built-in trait

2024-05-02 Thread Jason Merrill
On 5/2/24 12:20, Ken Matsui wrote: On Thu, May 2, 2024 at 8:34 AM Ken Matsui wrote: On Thu, May 2, 2024 at 8:16 AM Patrick Palka wrote: On Tue, 30 Apr 2024, Jason Merrill wrote: On 2/28/24 11:26, Ken Matsui wrote: This patch implements built-in trait for std::rank. __rank seems too

[PATCH RFA (cgraph)] c++: pragma target and static init [PR109753]

2024-05-02 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, OK for trunk? 14.2? This two-year-old thread seems relevant: https://gcc.gnu.org/pipermail/gcc-patches/2022-April/593410.html -- 8< -- #pragma target and optimize should also apply to implicitly-generated functions like static initialization functions and

Re: [PATCH] c++: Clear is_unbraced_* when parsing declaration_seq_opt [PR114917]

2024-05-02 Thread Jason Merrill
On 5/2/24 01:19, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- Currently we incorrectly retain "in_unbraced_linkage_specification_p" and "in_unbraced_export_declaration_p" when parsing a (braced) declaration-seq. This patch ensures

Re: [PATCH 2/2] c++: remove lookup_template_class's entering_scope flag

2024-05-01 Thread Jason Merrill
On 5/1/24 13:40, Patrick Palka wrote: On Wed, 1 May 2024, Jason Merrill wrote: On 5/1/24 12:41, Patrick Palka wrote: On Fri, 2 Feb 2024, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux, does this look like an improvement? This is not a bugfix and barely related

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

2024-05-01 Thread Jason Merrill
On 4/12/24 13:22, Patrick Palka wrote: On Fri, 12 Apr 2024, Jason Merrill wrote: 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

Re: [PATCH 2/4] c++/modules: Track module purview for deferred instantiations [PR114630]

2024-05-01 Thread Jason Merrill
On 5/1/24 12:11, Patrick Palka wrote: On Wed, 1 May 2024, Jason Merrill wrote: On 5/1/24 08:54, Patrick Palka wrote: On Thu, 2 May 2024, Nathaniel Shead wrote: On Wed, May 01, 2024 at 10:11:20AM -0400, Patrick Palka wrote: On Wed, 1 May 2024, Nathaniel Shead wrote: Bootstrapped

Re: [PATCH 2/2] c++: remove lookup_template_class's entering_scope flag

2024-05-01 Thread Jason Merrill
On 5/1/24 12:41, Patrick Palka wrote: On Fri, 2 Feb 2024, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux, does this look like an improvement? This is not a bugfix and barely related to the previous patch, but the previous patch's new use of entering_scope=true motivated me

[pushed] c++: drop in-charge for dtors without vbases

2024-05-01 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- Constructors and destructors use the in-charge parameter to decide whether they're responsible for recursing into virtual bases. Historically all destructors had this parameter in order to also distinguish the deleting destructor. But

Re: [PATCH] c++: Implement C++26 P2573R2 - = delete("should have a reason"); [PR114458]

2024-05-01 Thread Jason Merrill
On 5/1/24 23:33, Jakub Jelinek wrote: The following patch implements the C++26 P2573R2 = delete("should have a reason"); paper. I've tried to avoid increasing compile time memory for it when it isn't used (e.g. by adding a new lang_decl tree member), so the reason is represented as STRING_CST

Re: [PATCH 2/4] c++/modules: Track module purview for deferred instantiations [PR114630]

2024-05-01 Thread Jason Merrill
On 5/1/24 08:54, Patrick Palka wrote: On Thu, 2 May 2024, Nathaniel Shead wrote: On Wed, May 01, 2024 at 10:11:20AM -0400, Patrick Palka wrote: On Wed, 1 May 2024, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- When calling

[pushed] c++: const void* memchr [PR113706]

2024-05-01 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- The C++ standard specifies that the functions have const and non-const overloads, unlike C's single function with const argument and non-const return. Many systems don't actually implement this, but only add an overload with non-const

Re: [PATCH v4 4/4] Update the C/C++ FE routines

2024-05-01 Thread Jason Merrill
On 5/1/24 08:19, Qing Zhao wrote: "add_flexible_array_elts_to_size" and "layout_var_decl" to handle the cases when the DECL is union. Add testing cases to test the _bos for flexible array members in unions or alone in structures. gcc/c/ChangeLog: * c-decl.cc

Re: [PATCH 4/4] c++: Add new xtreme-header testcase for GMF discarding

2024-05-01 Thread Jason Merrill
On 5/1/24 03:01, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. Another thought would be to replace xtreme-header.h with so that we don't need to keep it up-to-date in the future. But this patch just does the obviously correct thing. -- >8 --

Re: [PATCH 1/4] c++/modules: Don't emit unused GMF partial specializations [PR114630]

2024-05-01 Thread Jason Merrill
On 5/1/24 02:59, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? OK. -- >8 -- The change in r14-8408 to also emit partial specializations in the global module fragment caused the regression in the linked PR; this patch fixes this by restricting

Re: [PATCH 2/4] c++/modules: Track module purview for deferred instantiations [PR114630]

2024-05-01 Thread Jason Merrill
On 5/1/24 07:11, Patrick Palka wrote: On Wed, 1 May 2024, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- When calling instantiate_pending_templates at end of parsing, any new functions that are instantiated from this point have their module

Re: [PATCH] c++: Implement modules ABI for vtable emissions

2024-05-01 Thread Jason Merrill
On 5/1/24 04:37, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- This patch implements the changes described in https://github.com/itanium-cxx-abi/cxx-abi/pull/171. One restriction that is lifted in the ABI that hasn't been updated here is that

Re: [PATCH v3 1/4] Allow flexible array members in unions and alone in structures [PR53548]

2024-04-30 Thread Jason Merrill
On 4/30/24 14:49, Qing Zhao wrote: On Apr 30, 2024, at 15:45, Qing Zhao wrote:  gcc/doc/extend.texi | 34 ++  1 file changed, 34 insertions(+) diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi index 7b54a241a7bf..cba98c8aadd7 100644 ---

Re: [PATCH v3 1/4] Allow flexible array members in unions and alone in structures [PR53548]

2024-04-30 Thread Jason Merrill
On 4/30/24 14:45, Qing Zhao wrote: On Apr 30, 2024, at 15:27, Jason Merrill wrote: On 4/30/24 07:58, Qing Zhao wrote: The request for GCC to accept that the C99 flexible array member can be in a union or alone in a structure has been made a long time ago around 2012 for supporting

  1   2   3   4   5   6   7   8   9   10   >