[gcc r15-2277] c++: parse error with -std=c++14 -fconcepts [PR116071]

2024-07-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:8c71830b51e6fd10087ce3f6791de80eb1f10b96 commit r15-2277-g8c71830b51e6fd10087ce3f6791de80eb1f10b96 Author: Jason Merrill Date: Wed Jul 24 16:20:33 2024 -0400 c++: parse error with -std=c++14 -fconcepts [PR116071] cp_parser_simple_type_specifier tries

[pushed] c++: parse error with -std=c++14 -fconcepts [PR116071]

2024-07-24 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- cp_parser_simple_type_specifier tries a variety of different things that might qualify as a user-defined type: an actual type-name, a constrained auto, a CTAD placeholder. In a context where a type-specifier is optional, this is all

Re: [PATCH 2/2] cp+coroutines: teach convert_to_void to diagnose discarded co_awaits

2024-07-24 Thread Jason Merrill
On 7/24/24 4:20 PM, Arsen Arsenović wrote: Hi Jason, Thanks for the review. Jason Merrill writes: On 7/23/24 7:41 PM, Arsen Arsenović wrote: co_await expressions are nearly calls to Awaitable::await_resume, and, as such, should inherit its nodiscard. A discarded co_await expression should

Re: [PATCH 2/2] cp+coroutines: teach convert_to_void to diagnose discarded co_awaits

2024-07-24 Thread Jason Merrill
On 7/23/24 7:41 PM, Arsen Arsenović wrote: co_await expressions are nearly calls to Awaitable::await_resume, and, as such, should inherit its nodiscard. A discarded co_await expression should, hence, act as if its call to await_resume was discarded. CO_AWAIT_EXPR trees do conveniently contain

Re: [PATCH 1/2] cp/coroutines: do not rewrite parameters in unevaluated contexts

2024-07-24 Thread Jason Merrill
On 7/23/24 7:41 PM, Arsen Arsenović wrote: It is possible to use parameters of a parent function of a lambda in unevaluated contexts without capturing them. By not capturing them, we work around the usual mechanism we use to prevent rewriting captured parameters. Prevent this by simply

Re: [PATCH] c++: Mostly concepts related formatting fixes

2024-07-24 Thread Jason Merrill
On 7/24/24 1:33 PM, Jakub Jelinek wrote: Hi! When playing with P2963R3, while reading and/or modifying code I've fixed various comment or code formatting issues (and in 3 spots also comment wording), but including that in the WIP P2963R3 patch made that patch totally unreadable because these

[gcc r15-2259] c++: add fixed testcase [PR109997]

2024-07-24 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:eebe830013c0d66816dfcae7b7aa77de5646bcad commit r15-2259-geebe830013c0d66816dfcae7b7aa77de5646bcad Author: Jason Merrill Date: Wed Jul 24 11:07:42 2024 -0400 c++: add fixed testcase [PR109997] Fixed by r14-9713 for PR100667. PR c++/109997

Re: [PATCH] libcpp, c++: Optimize initializers using #embed in C++

2024-07-23 Thread Jason Merrill
On 7/17/24 3:47 AM, Jakub Jelinek wrote: Hi! This patch on top of the https://gcc.gnu.org/pipermail/gcc-patches/2024-June/655012.html https://gcc.gnu.org/pipermail/gcc-patches/2024-June/655013.html https://gcc.gnu.org/pipermail/gcc-patches/2024-July/657049.html patches which just introduce

Re: [PATCH] c++: array new with value-initialization, again [PR115645]

2024-07-23 Thread Jason Merrill
On 7/17/24 5:33 PM, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? Hmm, I thought I had replied to this already. -- >8 -- Unfortunately, my r15-1946 fix broke the attached testcase. In it, we no longer go into the /* P1009: Array size deduction in

Re: [PATCH] c++: fix wrong ambiguity resolution [PR29834]

2024-07-23 Thread Jason Merrill
On 7/23/24 4:18 PM, Marek Polacek wrote: On Tue, Jul 23, 2024 at 12:53:07AM -0400, Jason Merrill wrote: On 7/20/24 2:31 PM, Marek Polacek wrote: [ Entering the contest to fix the oldest PR in this cycle. ] Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- This 18-year-

Re: [PATCH] c++, contracts: Ensure return statements on checkers.

2024-07-23 Thread Jason Merrill
On 6/17/24 8:14 AM, Iain Sandoe wrote: This is a minor tidy-up, tested on x86_64-darwin, OK For trunk? thanks Iain --- 8< --- At present, for pre-conditions and for post-conditions with a void return, we are not emitting a return statement. This patch adds the relevant return statements.

Re: [PATCH] c++/modules: Stream warning suppressions [PR115757]

2024-07-23 Thread Jason Merrill
On 7/7/24 12:39 AM, Nathaniel Shead wrote: Bootstrapped on x86_64-pc-linux-gnu, successfully regtested modules.exp; OK for trunk if full regtest passes? Patrick, I assume this change won't mess with your streaming optimizations? OK with Patrick's approval or on Friday, whichever comes first.

Re: [PATCH] c++/modules: Ensure deduction guides are always reachable [PR115231]

2024-07-23 Thread Jason Merrill
On 6/15/24 10:29 PM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? This probably isn't the most efficient approach, since we need to do name lookup to find deduction guides for a type which will also potentially do a bunch of pointless lazy loading from

Re: [PATCH v10 1/3] C++: Support clang compatible [[musttail]] (PR83324)

2024-07-23 Thread Jason Merrill
On 7/18/24 7:46 PM, Andi Kleen wrote: Updated patch with the !retval bug fix identified by Marek. OK. This patch implements a clang compatible [[musttail]] attribute for returns. musttail is useful as an alternative to computed goto for interpreters. With computed goto the interpreter

Re: [PATCH] c++: normalizing ttp parm constraints [PR115656]

2024-07-23 Thread Jason Merrill
On 7/23/24 9:37 AM, Patrick Palka wrote: On Tue, 23 Jul 2024, Jason Merrill wrote: On 7/5/24 12:18 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14 and perhaps 13? Alternatively we can set current_template_parms from weakly_subsumes

Re: [PATCH] c++: normalizing ttp parm constraints [PR115656]

2024-07-23 Thread Jason Merrill
On 7/5/24 12:18 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14 and perhaps 13? Alternatively we can set current_template_parms from weakly_subsumes instead, who has only one caller anyway. Would it also work to pass tmpl instead of

Re: [PATCH] c++: missing SFINAE during alias CTAD [PR115296]

2024-07-23 Thread Jason Merrill
On 7/19/24 12:24 PM, Patrick Palka wrote: On Fri, 19 Jul 2024, Jason Merrill wrote: On 7/19/24 10:55 AM, Patrick Palka wrote: On Fri, Jul 5, 2024 at 1:50 PM Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? -- >8 -- During the al

Re: [PATCH] c++: fix wrong ambiguity resolution [PR29834]

2024-07-22 Thread Jason Merrill
On 7/20/24 2:31 PM, Marek Polacek wrote: [ Entering the contest to fix the oldest PR in this cycle. ] Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- This 18-year-old PR reports that we parse certain comma expressions as a declaration rather than statement when the

Re: [PATCH] c++: alias of alias tmpl with dependent attrs [PR115897]

2024-07-22 Thread Jason Merrill
On 7/19/24 10:30 AM, Patrick Palka wrote: On Thu, 18 Jul 2024, Jason Merrill wrote: On 7/18/24 12:45 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does thi look OK for trunk/14? -- >8 -- As a followup of r15-2047-g7954bb4fcb6fa8, we also need to consi

Re: [PATCH] c++: Remove CHECK_CONSTR

2024-07-22 Thread Jason Merrill
On 7/22/24 4:45 PM, Jakub Jelinek wrote: Hi! On Mon, Jul 22, 2024 at 11:48:51AM -0400, Patrick Palka wrote: FWIW this tree code seems to be a vestige of the initial Concepts TS implementation and is effectively unused, we can remove it outright. Here is a patch which removes that.

Re: [PATCH] c++/coroutines: correct passing *this to promise type

2024-07-22 Thread Jason Merrill
On 7/22/24 9:43 AM, Patrick Palka wrote: Tested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps backports? -- >8 -- When passing *this to the promise type ctor (or operator new) (as per [dcl.fct.def.coroutine]/4), we add an explicit cast to lvalue reference, but that's

Re: [PATCH] c++: Some cp-tree.def comment fixes

2024-07-22 Thread Jason Merrill
On 7/22/24 11:53 AM, Marek Polacek wrote: On Mon, Jul 22, 2024 at 11:48:51AM -0400, Patrick Palka wrote: On Mon, 22 Jul 2024, Jakub Jelinek wrote: Hi! While reading the fold expression and concept tree comments, I found various spots referring to non-existent macros etc. The following patch

Re: [PATCH] c++: missing SFINAE during alias CTAD [PR115296]

2024-07-19 Thread Jason Merrill
On 7/19/24 10:55 AM, Patrick Palka wrote: On Fri, Jul 5, 2024 at 1:50 PM Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? -- >8 -- During the alias CTAD transformation, if substitution failed for some guide we should just discard the

Re: [PATCH] c++: xobj fn call without obj [PR115783]

2024-07-19 Thread Jason Merrill
On 7/6/24 8:22 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? OK. -- >8 -- The code path for rejecting an object-less call to a non-static member function should also consider xobj member functions so that we properly reject the

Re: [PATCH] c-family: Introduce the -Winvalid-noreturn flag from clang with extra tuneability

2024-07-19 Thread Jason Merrill
On 7/19/24 2:29 AM, Julian Waters wrote: Attempting to resend with a different client, plain text enabled... Still corrupted by word wrap and quoted-printable encoding, unfortunately. Probably the easiest solution is to send the patch as an attachment rather than pasted into the message.

Re: [PATCH v3] c++: Hash placeholder constraint in ctp_hasher

2024-07-18 Thread Jason Merrill
On 7/18/24 11:01 AM, Seyed Sajad Kahani wrote: This patch addresses a difference between the hash function and the equality function for canonical types of template parameters (ctp_hasher). The equality function uses comptypes (typeck.cc) (with COMPARE_STRUCTURAL) and checks constraint equality

Re: [PATCH] c++: Add [dcl.init.aggr] examples to testsuite

2024-07-18 Thread Jason Merrill
On 7/18/24 8:49 AM, Jakub Jelinek wrote: Hi! When working on the #embed optimization support, I went recently through all of reshape_init_r* and today I read in detail all the P3106R1 changes and I believe we implement it that way for years. To double check that, I've added tests with the

[gcc r15-2150] c++: Hash placeholder constraint in ctp_hasher

2024-07-18 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:0f8261eae068850c8c48400159fc0a5b540d4d53 commit r15-2150-g0f8261eae068850c8c48400159fc0a5b540d4d53 Author: Seyed Sajad Kahani Date: Thu Jul 18 16:01:32 2024 +0100 c++: Hash placeholder constraint in ctp_hasher This patch addresses a difference between the

Re: [PATCH v6] c++: Fix constrained auto deduction in templ spec scopes [PR114915]

2024-07-18 Thread Jason Merrill
On 7/18/24 12:03 PM, Seyed Sajad Kahani wrote: When deducing auto for `adc_return_type`, `adc_variable_type`, and `adc_decomp_type` contexts (at the usage time), we try to resolve the outermost template arguments to be used for satisfaction. This is done by one of the following, depending on the

Re: [PATCH] c++: alias of alias tmpl with dependent attrs [PR115897]

2024-07-18 Thread Jason Merrill
On 7/18/24 12:45 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does thi look OK for trunk/14? -- >8 -- As a followup of r15-2047-g7954bb4fcb6fa8, we also need to consider dependent attributes when recursing into a non-template alias that names a dependent alias

Re: [PATCH] c++: implement DR1363 and DR1496 for __is_trivial [PR85723]

2024-07-18 Thread Jason Merrill
On 6/19/24 9:54 AM, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- is_trivial was introduced in which split POD into is_trivial and is_standard_layout. Later came CWG 1363. Since

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

2024-07-18 Thread Jason Merrill
On 7/18/24 12:33 AM, Nathaniel Shead wrote: On Wed, Jul 17, 2024 at 11:36:26PM -0400, Jason Merrill wrote: On 7/17/24 11:04 PM, Nathaniel Shead wrote: On Wed, Jul 17, 2024 at 01:12:34PM -0400, Jason Merrill wrote: On 5/1/24 11:27 AM, Jason Merrill wrote: On 5/1/24 07:11, Patrick Palka wrote

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

2024-07-17 Thread Jason Merrill
On 7/17/24 11:04 PM, Nathaniel Shead wrote: On Wed, Jul 17, 2024 at 01:12:34PM -0400, Jason Merrill wrote: On 5/1/24 11:27 AM, Jason Merrill wrote: 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

Re: [PATCH] c++/modules: Conditionally start timer during lazy load [PR115165]

2024-07-17 Thread Jason Merrill
On 7/17/24 10:36 PM, Nathaniel Shead wrote: On Wed, Jul 17, 2024 at 04:31:21PM -0400, Jason Merrill wrote: On 7/7/24 9:29 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? Or should I include a testcase? I haven't reduced one from using the full

Re: [PATCH] c++/modules: Conditionally start timer during lazy load [PR115165]

2024-07-17 Thread Jason Merrill
On 7/7/24 9:29 AM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? Or should I include a testcase? I haven't reduced one from using the full contents of C++23 yet but I can do so if you prefer. Would adding -ftime-report to the pr99166 test reproduce

Re: [PATCH] c++: prev declared hidden tmpl friend inst [PR112288]

2024-07-17 Thread Jason Merrill
On 7/8/24 8:28 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? OK. Interesting technique in that first test... -- >8 -- When instantiating a previously declared hidden template friend declared at class template scope such as

Re: [PATCH] c++: missing -Wunused-value for ! [PR114104]

2024-07-17 Thread Jason Merrill
On 7/17/24 3:20 PM, Patrick Palka wrote: On Tue, 16 Jul 2024, Jason Merrill wrote: On 7/16/24 10:31 AM, Eric Gallager wrote: On Mon, Jul 15, 2024 at 10:37 PM Patrick Palka wrote: Bootstrapped andrregtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Here we

Re: [PATCH] c-family: Introduce the -Winvalid-noreturn flag from clang with extra tuneability

2024-07-17 Thread Jason Merrill
of -fstrong-eval-order. The variable is defined by the Var(...) notation in c.opt, and the opts code handles setting it. On Tue, Jun 11, 2024 at 10:26 AM Jason Merrill wrote: On 6/10/24 03:13, Julian Waters wrote: Hi Jason, Thanks for the reply. I'm a little bit overwhelmed with university

Re: [PATCH] c++: Fix ICE on valid involving variadic constructor [PR111592]

2024-07-17 Thread Jason Merrill
On 7/9/24 12:13 PM, Simon Martin wrote: We currently ICE upon the following valid code, due to the fix made through commit 9efe5fbde1e8 OK. === cut here === struct ignore { ignore(...) {} }; template void InternalCompilerError(Args... args) { ignore{ ignore(args) ... }; } int main() {

Re: [PATCH] c++: diagnose failed qualified lookup into current inst

2024-07-17 Thread Jason Merrill
On 7/17/24 1:54 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk? OK. -- >8 -- When the scope of a qualified name is the current instantiation, and qualified lookup finds nothing at template definition time, then we know it'll find

Re: [PATCH v2] c++: Hash placeholder constraint in ctp_hasher

2024-07-17 Thread Jason Merrill
On 7/17/24 8:32 AM, Seyed Sajad Kahani wrote: This patch addresses a difference between the hash function and the equality function for canonical types of template parameters (ctp_hasher). The equality function uses comptypes (typeck.cc) (with COMPARE_STRUCTURAL) and checks constraint equality

Re: [PATCH] c++: wrong error initializing empty class [PR115900]

2024-07-17 Thread Jason Merrill
On 7/17/24 12:00 PM, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/14? OK. -- >8 -- In r14-409, we started handling empty bases first in cxx_fold_indirect_ref_1 so that we don't need to recurse and waste time. This caused a bogus "modifying a const object"

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

2024-07-17 Thread Jason Merrill
On 5/1/24 11:27 AM, Jason Merrill wrote: 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 functi

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Jason Merrill
On 7/16/24 6:54 PM, Andi Kleen wrote: On Tue, Jul 16, 2024 at 06:06:42PM -0400, Jason Merrill wrote: On 7/16/24 5:55 PM, Andi Kleen wrote: On Tue, Jul 16, 2024 at 12:52:31PM -0700, Andi Kleen wrote: On Tue, Jul 16, 2024 at 02:51:13PM -0400, Jason Merrill wrote: On 7/16/24 12:18 PM, Andi

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Jason Merrill
On 7/16/24 5:55 PM, Andi Kleen wrote: On Tue, Jul 16, 2024 at 12:52:31PM -0700, Andi Kleen wrote: On Tue, Jul 16, 2024 at 02:51:13PM -0400, Jason Merrill wrote: On 7/16/24 12:18 PM, Andi Kleen wrote: On Tue, Jul 16, 2024 at 11:17:14AM -0400, Jason Merrill wrote: On 7/16/24 11:15 AM, Andi

Re: [PATCH] c++: constrained partial spec type context [PR111890]

2024-07-16 Thread Jason Merrill
On 7/11/24 1:08 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? OK. -- >8 -- maybe_new_partial_specialization wasn't propagating TYPE_CONTEXT when creating a new class type corresponding to a constrained partial spec, which

Re: [PATCH] c++/contracts: ICE in C++ Contracts with '-fno-exceptions' [PR 110159]

2024-07-16 Thread Jason Merrill
On 7/16/24 11:26 AM, Nina Dinka Ranns wrote: On Tue, 16 Jul 2024 at 15:55, Jason Merrill <mailto:ja...@redhat.com>> wrote: On 7/16/24 5:03 AM, Nina Dinka Ranns wrote: > Hello, > > We currently only initialise terminate_fn if exceptions are enabled. &

[gcc r15-2076] c++/contracts: ICE in C++ Contracts with '-fno-exceptions' [PR 110159]

2024-07-16 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:40a990c8b512fd25bd7d7b45aa509e1880d77209 commit r15-2076-g40a990c8b512fd25bd7d7b45aa509e1880d77209 Author: Nina Ranns Date: Thu Jul 11 17:47:34 2024 +0100 c++/contracts: ICE in C++ Contracts with '-fno-exceptions' [PR 110159] We currently only initialise

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Jason Merrill
On 7/16/24 12:18 PM, Andi Kleen wrote: On Tue, Jul 16, 2024 at 11:17:14AM -0400, Jason Merrill wrote: On 7/16/24 11:15 AM, Andi Kleen wrote: In the adjusted test it looks like the types of f and g match, so I wouldn't expect an error. Good point! Missing the forest for the trees. Anyways

Re: [PATCH] c++, coroutines, contracts: Handle coroutine and void functions [PR110871,PR110872,PR115434].

2024-07-16 Thread Jason Merrill
On 7/16/24 12:05 PM, Iain Sandoe wrote: Hi Jason, On 15 Jul 2024, at 23:29, Jason Merrill wrote: On 7/12/24 1:03 PM, Iain Sandoe wrote: - More helpful for optimization might be to make the contracts a wrapper - function (for non-variadic functions), that could be inlined

Re: [PATCH] c++/modules: Propagate BINDING_VECTOR_*_DUPS_P on realloc [PR99242]

2024-07-16 Thread Jason Merrill
On 7/8/24 8:30 AM, Nathaniel Shead wrote: Bootstrapped and regtested (so far just modules.exp) on x86_64-pc-linux-gnu, OK for trunk/14 if full regtest succeeds? OK. -- >8 -- When importing modules, when a binding vector for a name runs out of slots it gets reallocated with a larger size,

Re: [PATCH v1] c++: Hash placeholder constraint in ctp_hasher

2024-07-16 Thread Jason Merrill
On 7/12/24 4:42 PM, Seyed Sajad Kahani wrote: This patch addresses a difference between the hash function and the equality function for canonical types of template parameters (ctp_hasher). The equality function uses comptypes (typeck.cc) (with COMPARE_STRUCTURAL) and checks constraint equality

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Jason Merrill
On 7/16/24 11:15 AM, Andi Kleen wrote: In the adjusted test it looks like the types of f and g match, so I wouldn't expect an error. Good point! Missing the forest for the trees. Anyways are the C++ patches ok with this change? I'm still looking for a test which does error because the types

Re: [PATCH] c++/contracts: ICE in C++ Contracts with '-fno-exceptions' [PR 110159]

2024-07-16 Thread Jason Merrill
On 7/16/24 5:03 AM, Nina Dinka Ranns wrote: Hello, We currently only initialise terminate_fn if exceptions are enabled. However, contract handling requires terminate_fn when building the contract as a contract failure may result in std::terminate call regardless of whether the exceptions are

Re: [PATCH] c++: missing -Wunused-value for ! [PR114104]

2024-07-16 Thread Jason Merrill
On 7/16/24 10:31 AM, Eric Gallager wrote: On Mon, Jul 15, 2024 at 10:37 PM Patrick Palka wrote: Bootstrapped andrregtested on x86_64-pc-linux-gnu, does this look OK for trunk? -- >8 -- Here we're neglecting to emit a -Wunused-value for eligible ! operator expressions, and in turn for !=

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-16 Thread Jason Merrill
On 7/15/24 11:24 PM, Andi Kleen wrote: On Mon, Jul 15, 2024 at 06:57:57PM -0400, Jason Merrill wrote: On 7/8/24 12:56 PM, Andi Kleen wrote: diff --git a/gcc/testsuite/g++.dg/musttail10.C b/gcc/testsuite/g++.dg/musttail10.C new file mode 100644 index ..9b7043b8a306 --- /dev/null

Re: [PATCH v9 08/10] Add tests for C/C++ musttail attributes

2024-07-15 Thread Jason Merrill
On 7/8/24 12:56 PM, Andi Kleen wrote: diff --git a/gcc/testsuite/g++.dg/musttail10.C b/gcc/testsuite/g++.dg/musttail10.C new file mode 100644 index ..9b7043b8a306 --- /dev/null +++ b/gcc/testsuite/g++.dg/musttail10.C @@ -0,0 +1,34 @@ +/* { dg-do compile { target { tail_call } } } */

Re: [PATCH] c++, coroutines, contracts: Handle coroutine and void functions [PR110871,PR110872,PR115434].

2024-07-15 Thread Jason Merrill
On 7/12/24 1:03 PM, Iain Sandoe wrote: HI Jason, On 9 Jul 2024, at 22:55, Jason Merrill wrote: On 7/9/24 11:52 AM, Iain Sandoe wrote: Hi Folks On 8 Jul 2024, at 20:57, Jason Merrill wrote: On 7/8/24 3:37 PM, Iain Sandoe wrote: On 8 Jul 2024, at 20:19, Jason Merrill wrote: On 6/17/24 8

Re: [PATCH] c++: alias template with dependent attributes [PR115897]

2024-07-15 Thread Jason Merrill
On 7/12/24 2:53 PM, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? -- >8 -- Here we're prematurely stripping the dependent alias template-id A to its defining-type-id T when used as a template argument, which in turn causes us to

Re: [PATCH 3/3] c++: Add locations to using_p OVERLOADs

2024-07-11 Thread Jason Merrill
On 7/9/24 9:55 AM, Nathaniel Shead wrote: On Mon, Jul 08, 2024 at 02:24:14PM -0400, Jason Merrill wrote: On 7/6/24 10:13 PM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? I have also been working on a patch that uses the locations of using-decls

Re: [PATCH v2 1/3] c++: Introduce USING_DECLs for non-function usings [PR114683]

2024-07-11 Thread Jason Merrill
On 7/11/24 6:22 AM, Nathaniel Shead wrote: On Tue, Jul 09, 2024 at 05:43:59PM -0400, Jason Merrill wrote: On 7/9/24 9:44 AM, Nathaniel Shead wrote: On Mon, Jul 08, 2024 at 12:26:41PM -0400, Jason Merrill wrote: For a using-decl in the same scope as the original decl, won't this replace it so

Re: [PATCH] c++, contracts: Fix ICE in create_tmp_var [PR113968]

2024-07-10 Thread Jason Merrill
On 7/10/24 5:37 AM, Nina Dinka Ranns wrote: On Tue, 9 Jul 2024 at 22:50, Jason Merrill <mailto:ja...@redhat.com>> wrote: On 7/9/24 6:41 AM, Nina Dinka Ranns wrote: > On Mon, 8 Jul 2024 at 16:01, Jason Merrill mailto:ja...@redhat.com> > <mailto:ja...@

[gcc r15-1942] c++, contracts: Fix ICE in create_tmp_var [PR113968]

2024-07-10 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:c829042849da4e82668db8c845ef0847264c8687 commit r15-1942-gc829042849da4e82668db8c845ef0847264c8687 Author: Nina Ranns Date: Thu Jul 4 17:08:58 2024 +0100 c++, contracts: Fix ICE in create_tmp_var [PR113968] During contract parsing, in grok_contract(), we

Re: [PATCH] c++, coroutines, contracts: Handle coroutine and void functions [PR110871,PR110872,PR115434].

2024-07-09 Thread Jason Merrill
On 7/9/24 11:52 AM, Iain Sandoe wrote: Hi Folks On 8 Jul 2024, at 20:57, Jason Merrill wrote: On 7/8/24 3:37 PM, Iain Sandoe wrote: On 8 Jul 2024, at 20:19, Jason Merrill wrote: On 6/17/24 8:15 AM, Iain Sandoe wrote: potentially_transformed_function_body (); } finally

Re: [PATCH v2] c++/modules: Keep entity mapping info across duplicate_decls [PR99241]

2024-07-09 Thread Jason Merrill
On 7/9/24 5:16 AM, Nathaniel Shead wrote: Ah right, thanks for spotting that. That does make it look a bit cleaner; here's an updated patch. Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk/14? OK. -- >8 -- When duplicate_decls finds a match with an existing imported

Re: [PATCH] c++, contracts: Fix ICE in create_tmp_var [PR113968]

2024-07-09 Thread Jason Merrill
On 7/9/24 6:41 AM, Nina Dinka Ranns wrote: On Mon, 8 Jul 2024 at 16:01, Jason Merrill <mailto:ja...@redhat.com>> wrote: On 7/8/24 7:47 AM, Nina Dinka Ranns wrote: > HI Jason, > > On Fri, 5 Jul 2024 at 17:31, Jason Merrill mailto:ja...@redhat.com>> wro

Re: [PATCH v2 1/3] c++: Introduce USING_DECLs for non-function usings [PR114683]

2024-07-09 Thread Jason Merrill
On 7/9/24 9:44 AM, Nathaniel Shead wrote: On Mon, Jul 08, 2024 at 12:26:41PM -0400, Jason Merrill wrote: For a using-decl in the same scope as the original decl, won't this replace it so only the using-decl is visible to lookup? I had expected to omit the USING_DECL in that case. Yup

Re: [PATCH] c++, coroutines, contracts: Handle coroutine and void functions [PR110871,PR110872,PR115434].

2024-07-08 Thread Jason Merrill
On 7/8/24 3:37 PM, Iain Sandoe wrote: Hello Jason, before re-working, I think I need some guidance. On 8 Jul 2024, at 20:19, Jason Merrill wrote: On 6/17/24 8:15 AM, Iain Sandoe wrote: This patch came out of a discussion on Mattermost about how to deal with contracts/coroutines integration

Re: [PATCH] c++, coroutines, contracts: Handle coroutine and void functions [PR110871,PR110872,PR115434].

2024-07-08 Thread Jason Merrill
On 6/17/24 8:15 AM, Iain Sandoe wrote: This patch came out of a discussion on Mattermost about how to deal with contracts/coroutines integration. Actually, it would also allow some semantic checking to be deferred until the same spot - at which time there are no dependent types, which can

Re: [PATCH 3/3] c++: Add locations to using_p OVERLOADs

2024-07-08 Thread Jason Merrill
On 7/6/24 10:13 PM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? I have also been working on a patch that uses the locations of using-decls in 'diagnose_name_conflict' and 'duplicate_decls' calls, but that will need a fair bit more work that I'll

Re: [PATCH 2/3] c++/modules: Handle redefinitions of using-decls

2024-07-08 Thread Jason Merrill
On 7/6/24 10:07 PM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- This fixes an ICE exposed by supporting exported non-function using-decls. Sometimes when preparing to define a class, xref_tag will find a using-decl belonging to a different

Re: [PATCH 1/3] c++: Introduce USING_DECLs for non-function usings [PR114683]

2024-07-08 Thread Jason Merrill
On 7/6/24 10:06 PM, Nathaniel Shead wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, OK for trunk? -- >8 -- With modules, a non-function using-declaration is not completely interchangable with the declaration that it refers to; in particular, such a using-declaration may be exported

Re: [PATCH] c++, contracts: Fix ICE in create_tmp_var [PR113968]

2024-07-08 Thread Jason Merrill
On 7/8/24 7:47 AM, Nina Dinka Ranns wrote: HI Jason, On Fri, 5 Jul 2024 at 17:31, Jason Merrill wrote: On 7/5/24 10:25 AM, Nina Dinka Ranns wrote: Certain places in contract parsing currently do not check for errors. This results in contracts with embedded errors which eventually confuse

Re: [PATCH] c++, contracts: Fix ICE in create_tmp_var [PR113968]

2024-07-05 Thread Jason Merrill
On 7/5/24 10:25 AM, Nina Dinka Ranns wrote: Certain places in contract parsing currently do not check for errors. This results in contracts with embedded errors which eventually confuse gimplify. Checks for errors added in grok_contract() and cp_parser_contract_attribute_spec() to exit early if

[gcc r15-1832] c++: OVERLOAD in diagnostics

2024-07-03 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:baac8f710e35cfea14060e5eca49dbb49ffc294d commit r15-1832-gbaac8f710e35cfea14060e5eca49dbb49ffc294d Author: Jason Merrill Date: Wed Jul 3 17:25:53 2024 -0400 c++: OVERLOAD in diagnostics In modules we can get an OVERLOAD around a non-function, so let's tail

[gcc r15-1831] c++: CTAD and trait built-ins

2024-07-03 Thread Jason Merrill via Gcc-cvs
https://gcc.gnu.org/g:655fe94ae4c95d7f113c62787ca382d2742fad6f commit r15-1831-g655fe94ae4c95d7f113c62787ca382d2742fad6f Author: Jason Merrill Date: Wed Jul 3 17:27:48 2024 -0400 c++: CTAD and trait built-ins While poking at 101232 I noticed that we started trying to parse

[pushed] c++: CTAD and trait built-ins

2024-07-03 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- While poking at 101232 I noticed that we started trying to parse __is_invocable(_Fn, _Args...) as a functional cast to a CTAD placeholder type; we shouldn't consider CTAD for a template that shares a name (reserved for the implementation)

[pushed] c++: OVERLOAD in diagnostics

2024-07-03 Thread Jason Merrill
Tested x86_64-pc-linux-gnu, applying to trunk. -- 8< -- In modules we can get an OVERLOAD around a non-function, so let's tail recurse instead of falling through. As a result we start printing the template header in this testcase. gcc/cp/ChangeLog: * error.cc (dump_decl) [OVERLOAD]:

Re: [PATCH v2] c++: remove Concepts TS code

2024-07-03 Thread Jason Merrill
On 6/14/24 12:56 PM, Marek Polacek wrote: On Mon, Jun 10, 2024 at 10:23:37PM -0400, Jason Merrill wrote: On 6/10/24 11:13, Marek Polacek wrote: On Mon, Jun 10, 2024 at 10:22:11AM -0400, Patrick Palka wrote: On Fri, 7 Jun 2024, Marek Polacek wrote: @@ -3940,9 +3936,6 @@ find_parameter_packs_r

Re: [PATCH][c++ frontend]: check for missing condition for novector [PR115623]

2024-07-03 Thread Jason Merrill
On 6/27/24 11:25 AM, Tamar Christina wrote: -Original Message- From: Jason Merrill Sent: Tuesday, June 25, 2024 10:24 PM To: Tamar Christina Cc: gcc-patches@gcc.gnu.org; nd ; nat...@acm.org Subject: Re: [PATCH][c++ frontend]: check for missing condition for novector [PR115623] On 6/25

Re: [PATCH] c++: array new with value-initialization [PR115645]

2024-07-03 Thread Jason Merrill
On 7/2/24 4:43 PM, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk/branches? OK. -- >8 -- This extends the r11-5179 fix which doesn't work with multidimensional arrays. In particular, struct S { explicit S() { } }; auto p = new S[1][1]();

Re: [PATCH] c++, v2: Implement C++26 CWG2819 - Allow cv void * null pointer value conversion to object types in constant expressions

2024-07-03 Thread Jason Merrill
On 7/3/24 11:56 AM, Jakub Jelinek wrote: On Wed, Jul 03, 2024 at 11:35:26AM -0400, Jason Merrill wrote: This patch should also remove the integer_zerop diagnostic lower in the function, which becomes dead code with this change. So like this? Passed quick testing, ok if it passes full

Re: [PATCH] c++, libstdc++: Implement C++26 P2747R2 - constexpr placement new [PR115744]

2024-07-03 Thread Jason Merrill
On 7/3/24 10:37 AM, Jakub Jelinek wrote: +#if __cpp_lib_constexpr_new >= 202406L +# define _GLIBCXX_PLACEMENT_CONSTEXPR constexpr +#else +# define _GLIBCXX_PLACEMENT_CONSTEXPR inline +#endif I'm a bit curious why you want constexpr *or* inline rather than leaving the inline keyword on the

Re: [PATCH] c++: Implement C++26 CWG2819 - Allow cv void * null pointer value conversion to object types in constant expressions

2024-07-03 Thread Jason Merrill
On 7/3/24 10:39 AM, Jakub Jelinek wrote: Hi! The following patch implements CWG2819 (which wasn't a DR because it changes behavior of C++26 only). Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2024-07-03 Jakub Jelinek * constexpr.cc

Re: [PATCH] c++: Implement C++26 P0963R3 - Structured binding declaration as a condition [PR115745]

2024-07-02 Thread Jason Merrill
On 7/2/24 3:54 PM, Jakub Jelinek wrote: Hi! This C++26 paper allows structured bindings declaration in if/while/for/switch conditions, where the structured binding shouldn't be initialized by array (so in the standard only non-union class types; as extension _Complex will also work and vectors

Re: [PATCH] c++: Implement C++26 P3144R2 - Deleting a Pointer to an Incomplete Type Should be Ill-formed [PR115747]

2024-07-02 Thread Jason Merrill
-delete-incomplete makes it still compile without warnings like before, and -fpermissive makes it warn but not error; in SFINAE contexts it is considered an error in C++26 and later. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? OK. 2024-07-02 Jakub Jelinek Jason

Re: [PATCH] c++: Fix ICE on constexpr placement new [PR115754]

2024-07-02 Thread Jason Merrill
on x86_64-linux and i686-linux, ok for trunk? OK. 2024-07-02 Jakub Jelinek Jason Merrill PR c++/115754 * constexpr.cc (cxx_eval_constant_expression) : For conversions to void, pass vc_discard to the recursive call and otherwise for tcode other than

Re: [PATCH v2] c++: ICE with computed gotos [PR115469]

2024-07-01 Thread Jason Merrill
On 7/1/24 5:09 PM, Marek Polacek wrote: On Mon, Jul 01, 2024 at 02:44:56PM -0400, Jason Merrill wrote: On 6/26/24 6:04 PM, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- This is a low-prio crash on invalid code where we ICE on a VAR_D

Re: [PATCH] c++: unresolved overload with comma op [PR115430]

2024-07-01 Thread Jason Merrill
On 6/26/24 11:42 AM, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? OK. -- >8 -- This works: template int Func(T); typedef int (*funcptrtype)(int); funcptrtype fp0 = ; but this doesn't: funcptrtype fp2 = (0, ); because we only call

Re: [PATCH] build: Fix "make install" for MinGW

2024-07-01 Thread Jason Merrill
On 6/30/24 5:09 PM, Lewis Hyatt wrote: Hello- I noticed this while trying to test another patch on Windows (using the MSYS2 environment). Tested that it fixes the issue for x86_64-w64-mingw32 and doesn't affect anything for x86_64-pc-linux-gnu. It looks like the same fix for C was applied back

Re: [PATCH] c++: ICE with computed gotos [PR115469]

2024-07-01 Thread Jason Merrill
On 6/26/24 6:04 PM, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? -- >8 -- This is a low-prio crash on invalid code where we ICE on a VAR_DECL with erroneous type. I thought I'd try to avoid putting such decls into ->names and ->names_in_scope but that

Re: [PATCH] c++: Relax too strict assert in stabilize_expr [PR111160]

2024-07-01 Thread Jason Merrill
On 6/26/24 3:00 PM, Simon Martin wrote: The case in the ticket is an ICE on invalid due to an assert in stabilize_expr, but the underlying issue can actually trigger on this *valid* code: === cut here === struct TheClass { TheClass() {} TheClass(volatile TheClass& t) {} TheClass

Re: [PATCH] c++: DR2627, Bit-fields and narrowing conversions [PR94058]

2024-07-01 Thread Jason Merrill
On 6/28/24 7:00 PM, Marek Polacek wrote: Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? OK. -- >8 -- This DR (https://cplusplus.github.io/CWG/issues/2627.html) says that even if we are converting from an integer type or unscoped enumeration type to an integer type that cannot

Re: consistent unspecified pointer comparison

2024-06-27 Thread Jason Merrill via Gcc
On Thu, Jun 27, 2024 at 2:38 PM Richard Biener wrote: > > Am 27.06.2024 um 19:04 schrieb Jason Merrill via Gcc : > > > > https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2434r1.html > > proposes to require that repeated unspecified comparisons be > &g

consistent unspecified pointer comparison

2024-06-27 Thread Jason Merrill via Gcc
https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2434r1.html proposes to require that repeated unspecified comparisons be self-consistent, which does not match current behavior in either GCC or Clang. The argument is that the current allowance to be inconsistent is user-unfriendly and

Re: [PATCH] c++: decltype of by-ref capture proxy of ref [PR115504]

2024-06-25 Thread Jason Merrill
On 6/25/24 11:45, Patrick Palka wrote: On Tue, 25 Jun 2024, Jason Merrill wrote: On 6/25/24 11:03, Patrick Palka wrote: On Mon, 24 Jun 2024, Jason Merrill wrote: On 6/24/24 21:00, Patrick Palka wrote: Bootstrapped and regtested on x86_64-pc-linux-gnu, does this look OK for trunk/14? -- &g

Re: [PATCH][c++ frontend]: check for missing condition for novector [PR115623]

2024-06-25 Thread Jason Merrill
On 6/25/24 12:52, Tamar Christina wrote: The 06/25/2024 17:10, Jason Merrill wrote: On 6/25/24 04:01, Tamar Christina wrote: Hi All, It looks like I forgot to check in the C++ frontend if a condition exist for the loop being adorned with novector. This causes a segfault because cond isn't

Re: [PATCH] c++: ICE with __has_unique_object_representations [PR115476]

2024-06-25 Thread Jason Merrill
On 6/25/24 15:07, Marek Polacek wrote: On Tue, Jun 25, 2024 at 06:22:56PM +0100, Jonathan Wakely wrote: On Tue, 25 Jun 2024 at 16:17, Jason Merrill wrote: On 6/25/24 07:15, Jonathan Wakely wrote: On Tue, 25 Jun 2024 at 03:12, Jason Merrill wrote: On 6/18/24 10:31, Marek Polacek wrote

Re: [PATCH][c++ frontend]: check for missing condition for novector [PR115623]

2024-06-25 Thread Jason Merrill
On 6/25/24 04:01, Tamar Christina wrote: Hi All, It looks like I forgot to check in the C++ frontend if a condition exist for the loop being adorned with novector. This causes a segfault because cond isn't expected to be null. This fixes it by issuing the same kind of diagnostics we issue for

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

2024-06-25 Thread Jason Merrill
On 6/13/24 13:00, Patrick Palka wrote: On Thu, 13 Jun 2024, Jason Merrill wrote: On 6/13/24 11:05, Patrick Palka wrote: On Thu, 23 May 2024, Jason Merrill wrote: 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

  1   2   3   4   5   6   7   8   9   10   >