Re: configure adds -std=gnu++11 to CXX variable

2024-05-29 Thread Jason Merrill via Gcc
On Wed, May 29, 2024 at 1:34 PM Tom Tromey wrote: > >>>>> "Jason" == Jason Merrill writes: > > Jason> Thanks, though I don't think all that code needs to go; > Jason> AC_PROG_CXX_STDCXX_EDITION_TRY still looks useful for a project that > Jason> r

[gcc r15-902] c++: pragma target and static init [PR109753]

2024-05-29 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:eff00046409a7289bfdc1861e68b532895f91c0e commit r15-902-geff00046409a7289bfdc1861e68b532895f91c0e Author: Jason Merrill Date: Wed Feb 14 17:18:17 2024 -0500 c++: pragma target and static init [PR109753] #pragma target and optimize should also apply

[pushed] c++: pragma target and static init [PR109753]

2024-05-29 Thread Jason Merrill
Revised to drop the cgraph change so I can self-approve the remaining patch. Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- #pragma target and optimize should also apply to implicitly-generated functions like static initialization functions and defaulted special member functions.

[gcc r15-900] c++: add module extensions

2024-05-29 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:ff41abdca0ab9993b6170b9b1f46b3a40921f1b0 commit r15-900-gff41abdca0ab9993b6170b9b1f46b3a40921f1b0 Author: Jason Merrill Date: Thu May 16 16:09:12 2024 -0400 c++: add module extensions There is a trend in the broader C++ community to use a different extension

[pushed] c++: add module extensions

2024-05-29 Thread Jason Merrill
Revised to change mkdeps and the docs. Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- There is a trend in the broader C++ community to use a different extension for module interface units, even though (in GCC) they are compiled in the same way as other source files. Let's recognize

Re: [PATCH v2] C/C++: add hints for strerror

2024-05-29 Thread Jason Merrill
Pushed, thanks! On 2/27/24 20:13, Oskari Pirhonen wrote: Add proper hints for implicit declaration of strerror. The results could be confusing depending on the other included headers. These example messages are from compiling a trivial program to print the string for an errno value. It only

[gcc r15-897] c-family: add hints for strerror

2024-05-29 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:19c491d1848a8410559247183597096778967edf commit r15-897-g19c491d1848a8410559247183597096778967edf Author: Oskari Pirhonen Date: Tue Feb 27 19:13:30 2024 -0600 c-family: add hints for strerror Add proper hints for implicit declaration of strerror.

Re: [PATCH v3 #1/2] enable adjustment of return_pc debug attrs

2024-05-28 Thread Jason Merrill
On 5/25/24 08:12, Alexandre Oliva wrote: On Apr 27, 2023, Alexandre Oliva wrote: On Apr 14, 2023, Alexandre Oliva wrote: On Mar 23, 2023, Alexandre Oliva wrote: This patch introduces infrastructure for targets to add an offset to the label issued after the call_insn to set the

Re: [PATCH] c++: canonicity of fn types w/ instantiated eh specs [PR115223]

2024-05-28 Thread Jason Merrill
On 5/25/24 19:18, Patrick Palka wrote: Bootstrap and regtest on x86_64-pc-linux-gnu in progress, does this look OK for trunk if successful? OK. -- >8 -- When propagating structural equality in build_cp_fntype_variant, we should consider structural equality of the exception-less variant, not

Re: [PATCH] c++/modules: Prevent revealing a using-decl affecting cached overloads [PR114867]

2024-05-28 Thread Jason Merrill
On 5/26/24 09:01, Nathaniel Shead wrote: Is this approach OK? Alternatively I suppose we could do a deep copy of the overload list when this occurs to ensure we don't affect existing referents, would that be preferable? This strategy makes sense, but I have other concerns: Bootstrapped and

Re: configure adds -std=gnu++11 to CXX variable

2024-05-28 Thread Jason Merrill via Gcc
On Tue, May 28, 2024 at 12:49 PM Paul Eggert wrote: > > On 2024-05-28 08:02, Jakub Jelinek wrote: > > even for C GCC updates the default > > True, but C seems to be different, in that using a later-than-default > -std=whatever is more likely to help than hurt, because the C > standardization

Re: configure adds -std=gnu++11 to CXX variable

2024-05-28 Thread Jason Merrill via Gcc
On Tue, May 28, 2024 at 10:36 AM Paul Eggert wrote: > > On 2024-05-28 01:20, Jonathan Wakely wrote: > > I am not aware of any distro ever changing the default -std setting for g++ > > or clang++. Are you attempting to solve a non-problem, but introducing new > > ones? > > If it's a non-problem

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

[gcc r11-11448] c++: unroll pragma in templates [PR111529]

2024-05-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:a644775c363979bc25951532819ffa0f244b82f4 commit r11-11448-ga644775c363979bc25951532819ffa0f244b82f4 Author: Jason Merrill Date: Fri Sep 22 12:10:11 2023 +0100 c++: unroll pragma in templates [PR111529] We were failing to handle ANNOTATE_EXPR

[gcc r11-11449] c++: array of PMF [PR113598]

2024-05-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:38de942670ad39c60ba4feae893d11843e0aebe8 commit r11-11449-g38de942670ad39c60ba4feae893d11843e0aebe8 Author: Jason Merrill Date: Thu Jan 25 12:02:07 2024 -0500 c++: array of PMF [PR113598] Here AGGREGATE_TYPE_P includes pointers to member functions, which

[gcc r11-11447] c++: __is_constructible ref binding [PR100667]

2024-05-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:16046a075cb54c90609825e30b2ab45a03395ca1 commit r11-11447-g16046a075cb54c90609825e30b2ab45a03395ca1 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

[gcc r12-10470] c++: __is_constructible ref binding [PR100667]

2024-05-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:ba57a52dbf6a64ba66f72c20064c5c0e8cc9dbbb commit r12-10470-gba57a52dbf6a64ba66f72c20064c5c0e8cc9dbbb 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

[gcc r12-10469] c++: fix PR111529 backport

2024-05-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:6a5dcdb7ae6bbd9c5a273ceadc7f7c7cd8a6c8ec commit r12-10469-g6a5dcdb7ae6bbd9c5a273ceadc7f7c7cd8a6c8ec Author: Jason Merrill Date: Fri May 24 11:19:29 2024 -0400 c++: fix PR111529 backport r12-10468-g19827831516023 added the ANNOTATE_EXPR in the wrong place

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

[gcc r14-10242] c++: deleting array temporary [PR115187]

2024-05-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:9031c027827bff44e1b55c366fc7034c43501b4c commit r14-10242-g9031c027827bff44e1b55c366fc7034c43501b4c Author: Jason Merrill Date: Wed May 22 18:41:27 2024 -0400 c++: deleting array temporary [PR115187] Decaying the array temporary to a pointer

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

[gcc r11-11446] c++: binding reference to comma expr [PR114561]

2024-05-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:b35afe75674ff9f79cf9685d099bc80f10442216 commit r11-11446-gb35afe75674ff9f79cf9685d099bc80f10442216 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

[gcc r12-10468] c++: unroll pragma in templates [PR111529]

2024-05-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:19827831516023f2dff449af0b228b2d60190a28 commit r12-10468-g19827831516023f2dff449af0b228b2d60190a28 Author: Jason Merrill Date: Fri Sep 22 12:10:11 2023 +0100 c++: unroll pragma in templates [PR111529] We were failing to handle ANNOTATE_EXPR

[gcc r12-10467] c++: array of PMF [PR113598]

2024-05-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:419b5e17eace9b6b985b9853db0dc1a5478375b6 commit r12-10467-g419b5e17eace9b6b985b9853db0dc1a5478375b6 Author: Jason Merrill Date: Thu Jan 25 12:02:07 2024 -0500 c++: array of PMF [PR113598] Here AGGREGATE_TYPE_P includes pointers to member functions, which

[gcc r12-10466] c++: binding reference to comma expr [PR114561]

2024-05-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:7076c565e22281e193aeafafbf40676426a64b75 commit r12-10466-g7076c565e22281e193aeafafbf40676426a64b75 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

[gcc r13-8799] c++: unroll pragma in templates [PR111529]

2024-05-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:53cdaa755de57e57ba9e787f232adc3cfde88209 commit r13-8799-g53cdaa755de57e57ba9e787f232adc3cfde88209 Author: Jason Merrill Date: Fri Sep 22 12:10:11 2023 +0100 c++: unroll pragma in templates [PR111529] We were failing to handle ANNOTATE_EXPR

[gcc r13-8798] c++: array of PMF [PR113598]

2024-05-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:5f1457841abc2fd8657a52d1371c983ac010f1cc commit r13-8798-g5f1457841abc2fd8657a52d1371c983ac010f1cc Author: Jason Merrill Date: Thu Jan 25 12:02:07 2024 -0500 c++: array of PMF [PR113598] Here AGGREGATE_TYPE_P includes pointers to member functions, which

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

[gcc r15-796] c++: deleting array temporary [PR115187]

2024-05-23 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:ed63cd2aa5b114565fe5499c3a6bf8da5e8e48ba commit r15-796-ged63cd2aa5b114565fe5499c3a6bf8da5e8e48ba Author: Jason Merrill Date: Wed May 22 18:41:27 2024 -0400 c++: deleting array temporary [PR115187] Decaying the array temporary to a pointer and then deleting

[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

[gcc r15-495] c++: ICE in build_deduction_guide for invalid template [PR105760]

2024-05-14 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:0003e469d4664397b65080a66ad7d6557bd7ffce commit r15-495-g0003e469d4664397b65080a66ad7d6557bd7ffce Author: Simon Martin Date: Mon May 6 15:20:10 2024 +0200 c++: ICE in build_deduction_guide for invalid template [PR105760] We currently ICE upon the following

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

[gcc r15-494] c++ comment adjustments for 114935

2024-05-14 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:1288283051435c6b23473448aa21fa9ca53fabac commit r15-494-g1288283051435c6b23473448aa21fa9ca53fabac Author: Jason Merrill Date: Tue May 14 17:37:08 2024 -0400 c++ comment adjustments for 114935 gcc/cp/ChangeLog: * decl.cc (wrap_cleanups_r

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.

[gcc r14-10165] c++: initializer_list and EH [PR114935]

2024-05-03 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:3b4d6b6ecd79df790bf0938dab1f51094f94d777 commit r14-10165-g3b4d6b6ecd79df790bf0938dab1f51094f94d777 Author: Jason Merrill Date: Fri May 3 09:52:46 2024 -0400 c++: initializer_list and EH [PR114935] When we initialize an array of a type with a non-trivial

[gcc r15-138] c++: initializer_list and EH [PR114935]

2024-05-03 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:8f3afb83c879f1bfa722a963a07c06aaf174ef72 commit r15-138-g8f3afb83c879f1bfa722a963a07c06aaf174ef72 Author: Jason Merrill Date: Fri May 3 09:52:46 2024 -0400 c++: initializer_list and EH [PR114935] When we initialize an array of a type with a non-trivial

[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.

  1   2   3   4   5   6   7   8   9   10   >