Re: [PATCH] c++: Make *_cast<*> parsing more robust to errors [PR108438]

2024-06-08 Thread Simon Martin
Hi Jason, On 7 Jun 2024, at 19:30, Jason Merrill wrote: > On 6/7/24 08:12, Simon Martin wrote: >> We ICE upon the following when trying to emit a >> -Wlogical-not-parentheses >> warning: >> >> === cut here === >> template T foo (T arg, T& r

[PATCH] lto: Fix build on MacOS

2024-06-07 Thread Simon Martin
The build fails on x86_64-apple-darwin19.6.0 starting with 5b6d5a886ee because vector is included after system.h and runs into poisoned identifiers. This patch fixes this by defining INCLUDE_VECTOR before including system.h. Validated by doing a full build on x86_64-apple-darwin19.6.0.

[PATCH] c++: Make *_cast<*> parsing more robust to errors [PR108438]

2024-06-07 Thread Simon Martin
We ICE upon the following when trying to emit a -Wlogical-not-parentheses warning: === cut here === template T foo (T arg, T& ref, T* ptr) { int a = 1; return static_cast(a); } === cut here === This patch makes *_cast<*> parsing more robust by skipping to the closing '>' upon error in the

Re: [PATCH] c++: Handle erroneous DECL_LOCAL_DECL_ALIAS in duplicate_decls [PR107575]

2024-06-05 Thread Simon Martin
On 5 Jun 2024, at 10:34, Jakub Jelinek wrote: > On Wed, Jun 05, 2024 at 08:13:14AM +0000, Simon Martin wrote: >> --- a/gcc/cp/decl.cc >> +++ b/gcc/cp/decl.cc >> @@ -2792,10 +2792,13 @@ duplicate_decls (tree newdecl, tree olddecl, >> bool hiding, bool was_hidden) &

Re: [PATCH] c++: Handle erroneous DECL_LOCAL_DECL_ALIAS in duplicate_decls [PR107575]

2024-06-05 Thread Simon Martin
Hi, There was a formatting error, corrected in the updated attached patch :-/ On 5 Jun 2024, at 10:13, Simon Martin wrote: > We currently ICE upon the following because we don't properly handle > local > functions with an error_mark_node as DECL_LOCAL_DECL_ALIAS in > dup

[PATCH] c++: Handle erroneous DECL_LOCAL_DECL_ALIAS in duplicate_decls [PR107575]

2024-06-05 Thread Simon Martin
We currently ICE upon the following because we don't properly handle local functions with an error_mark_node as DECL_LOCAL_DECL_ALIAS in duplicate_decls. === cut here === void f (void) { virtual int f (void) const; virtual int f (void); } === cut here === This patch fixes this by checking

Re: [PATCH] PR c++/103338 - Add testcase for issue fixed by recent commit

2024-06-04 Thread Simon Martin
Hi Jason, On 4 Jun 2024, at 18:12, Jason Merrill wrote: > On 6/4/24 11:54, Simon Martin wrote: >> The case in that PR used to ICE until commit f04dc89. > > Interesting, I don't remember expecting that patch to change behavior > at all. This is the patch that git bisect

[PATCH] PR c++/103338 - Add testcase for issue fixed by recent commit

2024-06-04 Thread Simon Martin
The case in that PR used to ICE until commit f04dc89. This patch simply adds the case to the testsuite. Successfully tested on x86_64-pc-linux-gnu. PR c++/1033388 gcc/testsuite/ChangeLog: * g++.dg/parse/crash73.C: New test. --- gcc/testsuite/g++.dg/parse/crash73.C | 19

[PATCH] Add missing space after seen_error in gcc/cp/pt.cc

2024-06-04 Thread Simon Martin
I realized that I committed a change with a missing space after seen_error. This fixes it, as well as another occurrence in the same file. Apologies for the mistake - I'll commit this as obvious. gcc/cp/ChangeLog: * pt.cc (tsubst_expr): Add missing space after seen_error.

Re: [PATCH] Fix PR c++/111106: missing ; causes internal compiler error

2024-06-04 Thread Simon Martin
Hi Jason, Thanks for the review. On 31 May 2024, at 22:45, Jason Merrill wrote: > On 5/30/24 07:31, Simon Martin wrote: >> We currently fail upon the following because an assert in >> dependent_type_p >> fails for f's parameter >> >> === cut here === >&

[PATCH] Fix PR c++/109958: ICE taking the address of bound static member function brought into derived class by using-declaration

2024-05-31 Thread Simon Martin
From: Simon Martin We currently ICE upon the following because we don't properly handle the overload created for B::f through the using statement. === cut here === struct B { static int f(); }; struct D : B { using B::f; }; void f(D d) { } === cut here === This patch makes

[PATCH] Fix PR c++/111106: missing ; causes internal compiler error

2024-05-30 Thread Simon Martin
We currently fail upon the following because an assert in dependent_type_p fails for f's parameter === cut here === consteval int id (int i) { return i; } constexpr int f (auto i) requires requires { id (i) } { return i; } void g () { f (42); } === cut here === This patch fixes this by handling

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

2024-05-24 Thread Simon Martin
Hi, 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? Thanks! Simon PR c++/105229 gcc/testsuite/ChangeLog: *

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

2024-05-14 Thread Simon Martin
On 6 May 2024, at 18:28, Jason Merrill wrote: On 5/6/24 09:20, Simon Martin wrote: Hi, We currently ICE upon the following invalid snippet because we fail to properly handle tsubst_arg_types returning error_mark_node in build_deduction_guide. == cut == template struct A { A(Ts

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

2024-05-06 Thread Simon Martin
-linux-gnu. OK for trunk? Thanks! -- Simon diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a78d9d546d6..9acef73e7ac 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2024-05-06 Simon Martin + + PR c++/105760 + * pt.c (build_deduction_guide): Check

[PATCH] Fix PR c/35445: ICE with conflicting declarations

2011-05-01 Thread Simon Martin
. The attached patch fixes this by only calling 'composite_type' if 'comptypes' returned a non-zero value, as stated in this function's documentation. I've successfully bootstrapped and tested it on x86_64-apple-darwin10.6.0. Is it OK for trunk? Best regards, Simon 2011-05-01 Simon Martin simar