March 31, 2019 [Issue 19783] New: Fail to emplace struct with betterC | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=19783 Issue ID: 19783 Summary: Fail to emplace struct with betterC Product: D Version: D2 Hardware: x86_64 OS: Linux Status: NEW Severity: normal Priority: P1 Component: phobos Assignee: nobody@puremagic.com Reporter: kuettler@gmail.com When trying to emplace a struct with dmd -betterC, a linker reports a missing symbol. The program import core.stdc.stdlib; import std.conv; struct TestStruct { int i; } extern (C) int main(size_t argc, char** argv) { enum size = TestStruct.sizeof; auto buf = malloc(size); scope(exit) free(buf); auto r = emplace!TestStruct(buf[0 .. size]); return 0; } Leads to betterc_2.o: In function `_D3std4conv__T7emplaceTS9betterc_210TestStructZQBhFNaNbNiAvZPQBm': betterc_2.d:(.text._D3std4conv__T7emplaceTS9betterc_210TestStructZQBhFNaNbNiAvZPQBm[_D3std4conv__T7emplaceTS9betterc_210TestStructZQBhFNaNbNiAvZPQBm]+0x24): undefined reference to `_D3std4conv16testEmplaceChunkFNaNbNiNfAvmmZv' Without -betterC it works just fine. -- |
Copyright © 1999-2021 by the D Language Foundation