This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 1/2] Add unit test to aarch64 prologue analyzer
- From: Antoine Tremblay <antoine dot tremblay at ericsson dot com>
- To: Yao Qi <qiyaoltc at gmail dot com>
- Cc: Antoine Tremblay <antoine dot tremblay at ericsson dot com>, <gdb-patches at sourceware dot org>
- Date: Wed, 30 Nov 2016 11:41:44 -0500
- Subject: Re: [PATCH 1/2] Add unit test to aarch64 prologue analyzer
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=antoine dot tremblay at ericsson dot com;
- References: <1480428758-2481-1-git-send-email-yao.qi@linaro.org> <wwokbmwyxrit.fsf@ericsson.com> <20161130111459.GG22209@E107787-LIN> <wwoka8chxjyz.fsf@ericsson.com> <20161130163449.GI22209@E107787-LIN>
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
Yao Qi writes:
> 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.
>
OK.
> Using "=default" is not that clear. I personally prefer to write code
> in an explicit way, so I prefer putting "=default" at the end.
>
>>
>> I could not find mention of that in GCC's C++ conventions...
>
> IMO, using "=default" is a personal programming habit, so it is
> reasonable not to mention it in C++ code conventions.
OK thanks for the clarification.
The patch LGTM.