Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>,
	       Antoine Tremblay <antoine.tremblay@ericsson.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 1/2] Add unit test to aarch64 prologue analyzer
Date: Wed, 30 Nov 2016 18:16:00 -0000	[thread overview]
Message-ID: <911a9b62-5be4-f026-4bd6-c24a742a561a@redhat.com> (raw)
In-Reply-To: <20161130163449.GI22209@E107787-LIN>

On 11/30/2016 04:34 PM, Yao Qi wrote:
> On Wed, Nov 30, 2016 at 06:53:08AM -0500, Antoine Tremblay wrote:
>>>> Also I wonder if we need to specify the default constructor explicitly ?
>>>> Is there a rationale for it?
>>>>
>>>> It's never used too, unless you apply my previous comment.
>>>
>>> The instruction_reader_test default constructor is never used.  How
>>> about using "= delete"?
>>>
>>>     instruction_reader_test () = delete;
>>>     instruction_reader_test (std::initializer_list<uint32_t> init)
>>>       : insns{init} {}
>>
>> Yes that would be more appropriate if we're going to specify that.
>>
>> I just wrote a patch with a C++ class and did not include explicit
>> default constructors do you think we should make it a code convention to
>> explicitly specify their existence or non-existence (=default, =delete) ?
> 
> If you don't want default constructor to be used, "=delete" is useful,
> IMO, which tells compiler not to generate the default constructor.  The
> intention is quite clear that I don't want you to use the default
> constructor.

Note that if the class has a user-defined constructor, then the
default ctor is not generated at all.  So you don't need to delete
the default one then.  If I see a "=delete" in such case (as above),
I'll scratch my head wondering why the redundancy is there in the
first place, and maybe if so inclined that day remove the unnecessary
code as an obvious cleanup patch.  :-)

(deleted functions participate in overload resolution, so there's
a difference from the method not being defined, but I don't believe
that's what you were going for here.)

Thanks,
Pedro Alves


  parent reply	other threads:[~2016-11-30 18:16 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-29 14:12 Yao Qi
2016-11-29 14:12 ` [PATCH 2/2] [AArch64] Recognize STR instruction in prologue Yao Qi
2016-11-30 18:33   ` Pedro Alves
2016-11-29 14:58 ` [PATCH 1/2] Add unit test to aarch64 prologue analyzer Antoine Tremblay
2016-11-30 11:15   ` Yao Qi
2016-11-30 11:53     ` Antoine Tremblay
2016-11-30 16:35       ` Yao Qi
2016-11-30 16:42         ` Antoine Tremblay
2016-11-30 18:16         ` Pedro Alves [this message]
2016-11-30 18:29 ` Pedro Alves
2016-11-30 18:38   ` Pedro Alves
2016-11-30 19:30 ` Luis Machado
2016-12-01 12:53   ` Pedro Alves
2016-12-01 11:17 ` [PATCH 1/2 v2] " Yao Qi
2016-12-01 11:17   ` [PATCH 2/2 v2] [AArch64] Recognize STR instruction in prologue Yao Qi
2016-12-01 13:07     ` Pedro Alves
2016-12-02  9:42       ` Yao Qi
2016-12-01 12:57   ` [PATCH 1/2 v2] Add unit test to aarch64 prologue analyzer Pedro Alves
2016-12-01 15:21     ` Yao Qi
2016-12-01 16:04       ` Yao Qi
2016-12-01 18:05         ` Pedro Alves
2016-12-02  9:40           ` Yao Qi
2016-12-02 11:11             ` 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=911a9b62-5be4-f026-4bd6-c24a742a561a@redhat.com \
    --to=palves@redhat.com \
    --cc=antoine.tremblay@ericsson.com \
    --cc=gdb-patches@sourceware.org \
    --cc=qiyaoltc@gmail.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