* druntime: Copy array allocation functions to `core.internal.array.utils`
This copies `__setArrayAllocLength()`, `__arrayAlloc()` and moves
`__arrayStart()` and `__arrayClearPad()` to
`core.internal.array.utils.d`. This is needed because `_d_newarrayT()`
calls these functions from `rt.lifetime.d`, but the file cannot be
imported from `core.internal.array.creation.d`.
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
* Translate `_d_newarray{U,iT,T}` to a single template
This achieves the following:
- Convert `_d_newarray{U,iT,T}` to a single template `_d_newarrayT` that
handles arrays of elements that either have an init symbol or are
zero-initialised.
- Move compiler lowering to the semantic phase
- Store lowered expression in `NewExp.lowering`
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
---------
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
When an associative array field initializer was evaluated by CTFE, then
its "lowering" would neither be generated, nor copied back out of CTFE.
This would cause an assertion failure in dmd at src/dmd/todt.d(491).
For the `TypeInfo_Struct.xdtor` field, the linkage of the aggregate
itself plays no role; it's the linkage of the destructor that matters.
A real-life example for this is DMD's own `OutBuffer`.
* Fix 23103 - static initialization of associative arrays is not implemented
* Remove Phobos references in newaa.d
* Expand static AA support and tests
* Use minimized newaa implementation
* Test AA with immutable key/value
* Add semantic2done check before class initsem
* Add test for layout compatibility
* Address review comments
Without this limitation, the code could incorrectly concatenate
`["c"] ~ "a" ~ "b"` as `["c"] ~ "ab"`, which was incorrect.
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
* druntime: Restrict some `pragma(inline, false)` kludges to DMD only
They appear related to DMD's inlining at the AST level; LDC at least
doesn't need them, so let the optimizer decide for non-DMD backends.
* Fix little C++ header regression
* Expose VarArg.KRvariadic to C++ headers
* Revert "Deprecate alias this for classes v2 (#14812)" (#15326)
This reverts commit af7817b4ae.
* Add changelog for catch qualifier deprecation & update release no
---------
Co-authored-by: Martin Kinkelin <noone@nowhere.com>
Co-authored-by: Walter Bright <WalterBright@users.noreply.github.com>
Co-authored-by: Nick Treleaven <ntrel002@gmail.com>
* Fix Issue 15436 - Compiler still refers to AliasSeq-s as "tuple"-s
Replace "tuple type" with "type sequence".
Replace "tuple" with "sequence".
Pretty print `AliasSeq!(args)`, not `tuple(args)`.
Leave json as "tuple" for now.
Also mention std.typecons.Tuple when trying to return a sequence.
Note: This does not rename any internal compiler symbols.
* Update runnable tests
* Update stringof tests
* Update remaining tests
* retrigger tests
Move lowerings to `_d_array{setassign,assign_{l,r}}` to a `LoweredAssignExp` AST node
Signed-off-by: Razvan Nitu <razvan.nitu1305@gmail.com>
Merged-on-behalf-of: unknown
This brings the following changes:
- Improves the existing template `_d_arraycatnTX`, to now concatenates
both arrays and single elements
- Changes the lowerings to `_d_arraycatT` to use the new template
- Moves the lowering logic to `_d_arraycatnTX` to expressionsem.d
- Adds a new field to `CatExp` called `lowering` to store the template
lowering
- Removes the old non-template `_d_arraycatnTX` and `_d_arraycatT` hooks
- Moves `test19688.d` from `runnable/` to `compilable/` until
https://issues.dlang.org/show_bug.cgi?id=23408 is fixed
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
* fix Issue 23055 - importC: using compound-literal array as pointer in CTFE gives 'dereference of invalid pointer'
* fix Issue 23055 - importC: using compound-literal array as pointer in CTFE gives 'dereference of invalid pointer'