https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86135

--- Comment #6 from Sabetay Toros <sabetaytoros at gmail dot com> ---
Hi,





*Because the rules for direct-initialization (with parentheses)
andlist-initialization (with braces) are different. Different rules
meansdifferent things happen. *

the rules may be different but results must be the same.
There is a flaw here. If gcc is right in *list-initialization * then direct
initialization is wrong and should give the same result, the segmentation
fault. But it is not giving an error and it is working as expected.
If Clang is running both version without an error,  sorry you can not
defend this.
It cant be a biased result for achieving the initialization of a member.



On Wed, Jun 13, 2018 at 7:04 PM, redi at gcc dot gnu.org <
gcc-bugzi...@gcc.gnu.org> wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86135
>
> --- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
> (In reply to Sabetay Toros from comment #4)
> > If it is not a bug then why the parenthesis version is working.
>
> Because the rules for direct-initialization (with parentheses) and
> list-initialization (with braces) are different. Different rules means
> different things happen.
>
> > Moreover Strastroup advice is to use  the initializer list version in
> > constructing objects not the parenthesis.
>
> That's not always good advice.
>
> > Besides Clang does not suffer with that kind of error.  Both styles are
> > working.
>
> Clang does not follow the standard correctly in this respect.
>
> --
> You are receiving this mail because:
> You reported the bug.
>

Reply via email to