public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jason Merrill <jason@redhat.com>
To: Simon Martin <simon@nasilyan.com>, Jakub Jelinek <jakub@redhat.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] c++: Handle erroneous DECL_LOCAL_DECL_ALIAS in duplicate_decls [PR107575]
Date: Fri, 7 Jun 2024 13:32:41 -0400	[thread overview]
Message-ID: <386dfcea-4f8c-4347-864f-71f2fdd033e2@redhat.com> (raw)
In-Reply-To: <0102018fe7b31120-39abcd9a-dd10-4dd3-9e2c-a2160cfe2ab7-000000@eu-west-1.amazonses.com>

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 +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)
>>>   	  retrofit_lang_decl (newdecl);
>>>   	  tree alias = DECL_LOCAL_DECL_ALIAS (newdecl)
>>>   	    = DECL_LOCAL_DECL_ALIAS (olddecl);
>>> -	  DECL_ATTRIBUTES (alias)
>>> -	    = (*targetm.merge_decl_attributes) (alias, newdecl);
>>> -	  if (TREE_CODE (newdecl) == FUNCTION_DECL)
>>> -	    merge_attribute_bits (newdecl, alias);
>>> +	  if (alias != error_mark_node)
>>> +	    {
>>> +	      DECL_ATTRIBUTES (alias) =
>>> +		(*targetm.merge_decl_attributes) (alias, newdecl);
>>
>> Formatting nit, = should 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.

OK.



      reply	other threads:[~2024-06-07 17:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240605081311.97544-1-simon@nasilyan.com>
2024-06-05  8:13 ` Simon Martin
     [not found]   ` <9463D268-EDE6-4910-B5A0-5A241267E774@nasilyan.com>
2024-06-05  8:25     ` Simon Martin
2024-06-05  8:34   ` Jakub Jelinek
     [not found]     ` <C1F84795-035D-44E4-A5CD-E526C8CA026A@nasilyan.com>
2024-06-05  9:20       ` Simon Martin
2024-06-07 17:32         ` Jason Merrill [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=386dfcea-4f8c-4347-864f-71f2fdd033e2@redhat.com \
    --to=jason@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jakub@redhat.com \
    --cc=simon@nasilyan.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).