public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Keith Seitz <keiths@redhat.com>
To: Tom de Vries <tdevries@suse.de>, gdb-patches@sourceware.org
Subject: Re: [PATCH][gdb/c++] Print destructor the same for gcc and clang
Date: Thu, 29 Sep 2022 10:52:06 -0700	[thread overview]
Message-ID: <9992b2dc-60f4-539a-1727-1dc9546b2bc2@redhat.com> (raw)
In-Reply-To: <20220927103546.GA27362@delia.home>

On 9/27/22 03:35, Tom de Vries wrote:
> 
> Fix this by rewriting the code to:
> - always enter the loop
> - handle whether arguments need printing in the loop
> - keep track of how many arguments are printed, and
>    use that after the loop to print void etc.
> such that we have the same for both gcc and clang:
> ...
>      A(void);
>      ~A(void);
> ...
> 
> Note that I consider the discussion of whether we want to print:
> - A(void) / ~A(void), or
> - A() / ~A()
> out-of-scope for this patch.
> 
> Tested on x86_64-linux.
> 
> Any comments?

This all looks okay; thank you for that cleanup. Consistency is welcome.

On the [off-]topic of "void" vs ""... The standard (IIUC) permits the use of
"void" in destructors. If I create a class with a private dtor, e.g., to elicit
a compilation failure, clang++ never outputs the symbol name. GCC, on the other
hand, does, and it outputs "" (no "void", even if I explicitly use "void" in the
dtor).

While I would prefer "", I don't have a compelling argument either way. [It's
trivial to implement with your patch.]

I recommend you approve your patch. :-)

Keith


  parent reply	other threads:[~2022-09-29 17:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 10:35 Tom de Vries
2022-09-27 14:16 ` Bruno Larsen
2022-09-29 17:52 ` Keith Seitz [this message]
2022-09-29 20:03   ` Pedro Alves
2022-09-29 20:01 ` Pedro Alves

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=9992b2dc-60f4-539a-1727-1dc9546b2bc2@redhat.com \
    --to=keiths@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tdevries@suse.de \
    /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).