https://issues.dlang.org/show_bug.cgi?id=14402

Nick Treleaven <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice                         |accepts-invalid
                 CC|                            |[email protected]
           Assignee|[email protected]        |[email protected]
            Summary|std.conv.emplace segfaults  |std.conv.emplace segfaults
                   |for nested class            |for nested types

--- Comment #3 from Nick Treleaven <[email protected]> ---
(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.

--

Reply via email to