Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Simon Marchi <simon.marchi@polymtl.ca>
Cc: Simon Marchi <simon.marchi@ericsson.com>,
	gdb-patches@sourceware.org, arnez@linux.vnet.ibm.com
Subject: Re: [PATCH] Make dwarf_expr_piece::pieces an std::vector
Date: Thu, 14 Sep 2017 10:24:00 -0000	[thread overview]
Message-ID: <bdf858fd-f651-63f7-127b-ec3b64bd6e3a@redhat.com> (raw)
In-Reply-To: <20733c26c93b710b8554c149c02d3fb3@polymtl.ca>

On 09/14/2017 10:26 AM, Simon Marchi wrote:
> On 2017-09-14 11:21, Pedro Alves wrote:

>> I wonder if there's ever a case for 'const T &&' parameters,
>> and if GCC could warn about them.  At least in non-template
>> functions.
> 

FYI, I filed https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82213 now.

> Oops, I started with a const reference, before changing it to rvalue
> reference (and forgot to remove the const).  Does the patch look good to
> you otherwise?
> 

Sure, with tiny nit below.

>  /* Expand the memory allocated stack to contain at least
> @@ -285,14 +282,9 @@ dwarf_expr_context::stack_empty_p () const
>  void
>  dwarf_expr_context::add_piece (ULONGEST size, ULONGEST offset)
>  {
> -  struct dwarf_expr_piece *p;
> +  this->pieces.emplace_back ();
> +  dwarf_expr_piece *p = &(this->pieces.back ());
>

The extra parens look odd to me:

- dwarf_expr_piece *p = &(this->pieces.back ());
+ dwarf_expr_piece *p = &this->pieces.back ();

('p' could be a reference instead, since it's always
non-null, but I guess even better would be to move most
of the code below to a dwarf_expr_piece ctor.  But you don't
really have to do that.  I definitely understand not wanting
to change too much at a time.  And I wouldn't have said a thing
if it weren't for the parens making me pause.  :-))

Thanks,
Pedro Alves


  reply	other threads:[~2017-09-14 10:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-14  8:17 Simon Marchi
2017-09-14  9:21 ` Pedro Alves
2017-09-14  9:26   ` Simon Marchi
2017-09-14 10:24     ` Pedro Alves [this message]
2017-09-14 13:58       ` Simon Marchi
2017-09-14 14:14         ` 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=bdf858fd-f651-63f7-127b-ec3b64bd6e3a@redhat.com \
    --to=palves@redhat.com \
    --cc=arnez@linux.vnet.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@ericsson.com \
    --cc=simon.marchi@polymtl.ca \
    /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