dmd
dmd copied to clipboard
dmd D Programming Language compiler
This PR is for demonstrating the protoype implementation of the _d_arrayshrinkfit runtime hook. **This implementation:** - Creates a templated version of the hook: _d_arrayshrinkfitT in core/internal/array/capacity.d - Maintains compatibility by...
On FreeBSD 14, dmd-test fails with ``` FAILED targets: - runnable/helloc.c - compilable/stdcheaders.c gmake: *** [Makefile:86: dmd-test] Error 1 ``` Both of those files #include stdlib.h, so while the actual...
## Lance Bachmeier (@bachmeil) reported this on 2024-03-11T02:44:55Z ### Transferred from https://issues.dlang.org/show_bug.cgi?id=24435 ### Description ````markdown structdef.c: typedef struct { int a; double b; } foo; test.c: #include #include __import structdef;...
The following struct in C: ```c // bug.i typedef struct tagTIME_STRUCT { int hour; int minute; int second; } TIME_STRUCT; ``` Produces the following output snippet in ImportC in file...
There’s no reason a `lazy` parameter couldn’t be `ref` and also there’s no reason a `lazy` parameter couldn’t infer `ref` based on the argument provided. ```d void f(lazy int x)...
This is really strange! ```d enum Bytes = 16; // set this to whatever you like struct S { ubyte[Bytes] poo; } void main() { ubyte[Bytes] buf = void; S*...
## Jonathan M Davis (@jmdavis) reported this on 2024-11-18T11:30:12Z ### Transferred from https://issues.dlang.org/show_bug.cgi?id=24865 ### Description This code ```d void main() { import std.stdio; import std.traits; static struct S2 { ~this()...
Greatly reduce the amount of indentation, split out giving an overload error into a separate function. Best reviewed with whitespace off.
Inspiration from: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2429r0.pdf https://d.godbolt.org/z/ob37qK63s ```d struct widget {} void draw(ref widget); struct diagram {} void draw(ref diagram); enum isDrawable(T) = __traits(compiles, { static if(__traits(getMember, widget, "draw")) {} else static assert(0);...
```D import std.range : front; typeof((int[]).front); ``` As of DMD 2.111.0, this code produces this error: `Error: no property front for type int[], perhaps import std.range; is needed?` The error...