[Issue 21709] New: std.conv.emplace not usable in betterC - 2.096 beta
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Mar 13 16:11:09 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=21709
Issue ID: 21709
Summary: std.conv.emplace not usable in betterC - 2.096 beta
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: regression
Priority: P1
Component: druntime
Assignee: nobody at puremagic.com
Reporter: mmcomando at gmail.com
Our CI updated to dmd 2.096 and this error showed up:
/root/dlang/dmd-2.096.0/linux/bin64/../../src/druntime/import/core/internal/lifetime.d(35,13):
Error: Cannot use try-catch statements with -betterC
/root/dlang/dmd-2.096.0/linux/bin64/../../src/druntime/import/core/internal/lifetime.d(57,21):
Error: template instance `core.internal.lifetime.emplaceRef!(EntityManager,
EntityManager, uint, uint, uint).emplaceRef.S.__ctor!()` error instantiating
CI job url:
https://gitlab.com/mmcomando/bubel-ecs/-/jobs/1095299347
>From error message it seems that core.internal.lifetime.emplaceRef uses
try-catch statement which is not supported by -betterC.
I have tried to look for the code on github but I have not found lines with
try-catch in druntime/import/core/internal/lifetime.d(35,13) so I am not sure
if try-catch is the problem.
Part of our code which uses emplace:
static T* make(T, Args...)(Args args)
{
T* ret = cast(T*) malloc(T.sizeof);
static import std.conv;
static if (__traits(isPOD, T))
{
__gshared immutable T init = T.init;
memcpy(ret, &init, T.sizeof);
}
else static if (is(T == struct))
std.conv.emplace(ret, args);
return ret;
}
--
More information about the Digitalmars-d-bugs
mailing list