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

2024-06-07 Thread Jason Merrill
On 6/5/24 05:20, Simon Martin wrote: On 5 Jun 2024, at 10:34, Jakub Jelinek wrote: On Wed, Jun 05, 2024 at 08:13:14AM +, 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
be on the next line, not at the end of a > line. > See https://gcc.gnu.org/codingconventions.html and > https://gcc.gnu.org/codingconventions.html Indeed, thanks. This is fixed in the attached updated patch. Simon > > Jakub From e75602d3ce998307749e5022d989b564a6d19703 Mon Se

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

2024-06-05 Thread Jakub Jelinek
On Wed, Jun 05, 2024 at 08:13:14AM +, 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) > retrofit_lang_decl (newdecl); > tree alias = DECL_LOCAL_DECL_ALIAS (n

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

2024-06-05 Thread Simon Martin
"cannot have cv-qualifier" {} { target *-*-* } line_4 } > +// { dg-error "ambiguating new declaration of" {} { target *-*-* } > line_4 } > +// { dg-error "outside class declaration" {} { target *-*-* } line_5 > } > -- > 2.44.0 From e75602d3ce998307749e5022d989b564a6d19703 Mon

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