Thread overview
[Issue 14402] std.conv.emplace segfaults for nested class
[Issue 14402] std.conv.emplace for classes segfaults for nested class
Apr 03, 2015
Matt Kline
Apr 03, 2015
Matt Kline
Apr 05, 2015
Matt Kline
Apr 13, 2015
weaselcat
Oct 14, 2016
ponce
Apr 30, 2017
Walter Bright
[Issue 14402] std.conv.emplace segfaults for nested types
May 08, 2017
Nick Treleaven
May 08, 2017
Nick Treleaven
Dec 17, 2022
Iain Buclaw
April 03, 2015
https://issues.dlang.org/show_bug.cgi?id=14402

Matt Kline <mkline.on.d@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mkline.on.d@gmail.com

--
April 03, 2015
https://issues.dlang.org/show_bug.cgi?id=14402

Matt Kline <mkline.on.d@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|std.conv.emplace for        |std.conv.emplace segfaults
                   |classes segfaults for       |for nested class
                   |nested class                |

--
April 05, 2015
https://issues.dlang.org/show_bug.cgi?id=14402

--- Comment #1 from Matt Kline <mkline.on.d@gmail.com> ---
I just noticed that if you try to `new` a context-aware class or struct outside that context, you get a nice compiler warning indicating that you cannot do so. Can we, via template magic or something similar, issue a similar error when trying to emplace one?

--
April 13, 2015
https://issues.dlang.org/show_bug.cgi?id=14402

weaselcat <r9shackleford@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |r9shackleford@gmail.com

--
October 14, 2016
https://issues.dlang.org/show_bug.cgi?id=14402

ponce <aliloko@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aliloko@gmail.com

--- Comment #2 from ponce <aliloko@gmail.com> ---
Also rediscovered this bug.

--
April 30, 2017
https://issues.dlang.org/show_bug.cgi?id=14402

Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice
                 CC|                            |bugzilla@digitalmars.com

--
May 08, 2017
https://issues.dlang.org/show_bug.cgi?id=14402

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice                         |accepts-invalid
                 CC|                            |nick@geany.org
           Assignee|nobody@puremagic.com        |nick@geany.org
            Summary|std.conv.emplace segfaults  |std.conv.emplace segfaults
                   |for nested class            |for nested types

--- Comment #3 from Nick Treleaven <nick@geany.org> ---
(In reply to Matt Kline from comment #1)
> Can we, via template magic or something similar, issue a similar error when trying to emplace one?

I think so, I'm working on a PR. Basically the initializer args have to contain a type that has a usable context pointer. The remaining case is:

S s;
emplace(&s, S.init);

In solving that, I think disallowing rvalue initializers is too strict (as they could have a valid context pointer). Perhaps this can be detected at runtime instead.

--
May 08, 2017
https://issues.dlang.org/show_bug.cgi?id=14402

--- Comment #4 from Nick Treleaven <nick@geany.org> ---
https://github.com/dlang/phobos/pull/5379

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=14402

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P2

--