Comment #0 by n8sh.secondary — 2019-01-09T02:12:32Z
Assigning an array slice to another array slice works in betterC since https://github.com/dlang/dmd/pull/7867 but other array operations do not.
Example of non-working code:
---
version (D_BetterC)
extern(C) void main()
{
int[3] a, b;
a[] = 0; // Works.
a[] = b[]; // Works.
a[] = 1; // error: undefined reference to '_memset32'
a[] += 1; // Error: TypeInfo cannot be used with -betterC
a[] += b[]; // Error: TypeInfo cannot be used with -betterC
}
---
Comment #1 by n8sh.secondary — 2019-06-01T19:52:33Z
*** Issue 19753 has been marked as a duplicate of this issue. ***
Comment #2 by n8sh.secondary — 2019-06-01T19:55:37Z
The failure seems to be due to #19268 triggered in _arrayOps!Args.
Comment #3 by dlang-bot — 2019-06-02T05:01:16Z
dlang/druntime pull request #2622 "Issue 19561 - Enable array ops in betterC" was merged into master:
- c596b30147c762ba853948a76ca942c1456212f0 by Nathan Sashihara:
Issue 19561 - Enable array ops in betterC
Known limitation: slice assignment to a scalar won't work in betterC
for types of size other than 1 because the compiler will try to use
_memset16/_memset32/etc. This can only be addressed in DMD rather
than druntime.
https://github.com/dlang/druntime/pull/2622