[Bug c++/86135] At run time, when the constructor tries to construct an objects element with a initializer-list (using c++11 style) is giving segmentation fault. The old style of initialize with parenthesis is working properly.
sabetaytoros at gmail dot com
gcc-bugzilla@gcc.gnu.org
Wed Jun 13 15:36:00 GMT 2018
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-bugzilla@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.
>
More information about the Gcc-bugs
mailing list