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

--- Comment #4 from Sabetay Toros <sabetaytoros at gmail dot com> ---
*​" --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org
<http://gnu.org/>> ---This is not a bug, GCC is correct. With
list-initialization the compiler doesnot always select a copy/move
constructor even when the argument is the sametype as the object being
constructed. ​"*

If it is not a bug then why the parenthesis version is working.

Moreover Strastroup advice is to use  the initializer list version in
constructing objects not the parenthesis.

Besides Clang does not suffer with that kind of error.  Both styles are
working.

Sabetay

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

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86135
>
> Jonathan Wakely <redi at gcc dot gnu.org> changed:
>
>            What    |Removed                     |Added
> ------------------------------------------------------------
> ----------------
>              Status|WAITING                     |RESOLVED
>          Resolution|---                         |DUPLICATE
>
> --- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
> This is not a bug, GCC is correct. With list-initialization the compiler
> does
> not always select a copy/move constructor even when the argument is the
> same
> type as the object being constructed.
>
> *** This bug has been marked as a duplicate of bug 85577 ***
>
> --
> You are receiving this mail because:
> You reported the bug.
>

Reply via email to