I am fairly convinced that no possible arguments to or global state at the time
of any call to Thread.sleep can result in memory corruption.
There is a precondition on Thread.sleep, that the duration must be
non-negative. On Windows, Thread.sleep calls Sleep, which takes an unsigned
integer. On POSIX, Thread.sleep calls nanosleep, which is specified to handle
negative durations gracefully. As such, violating this precondition should not
be a source of undefined behavior.
* Remove the interface function fullCollectNoStack from the gcinterface
* Fix tests that depend on the GC not scanning the stack.
* Remove all nostack remnants
* Add changelog entry
* Fix Issue 14128 - AliasDeclaration allows expressions, causing false code for ThisExp
* Add test case
* Fix deprecation comment
* Add changelog
* Use dummy out param, not null
* Change to error with __edition_latest_do_not_use
* Implement __ctfeWrite builtin
Reworked stalled PR #12412.
The __ctfeWrite function is already part of druntime (core.builtins), but was never implemented.
The actual implementation is the one used at Weka (slightly different from PR #12412) and does not require any changes to expression.d (contrary to said PR).
* fix file extension of changelog entry
* fix changelog file naming
* Improve changelog entry
* Remove superfluous code and add test case.
This implements the Enhanced Interpolated Expression Sequence proposal:
i"" or iq{} or q`` with a $(expression) in the middle are converted to a tuple of druntime types for future processing by library code.
- Rejects MemoryOrder.rel and MemoryOrder.acq_rel as the `fail`
argument in atomicCompareExchangeStrong and atomicCompareExchangeWeak.
- Rejects `fail` argument having a stronger value than the `succ`
memory model.
These are rejected as invalid memory models if ever encountered
compiling with GDC or LDC, so make it also rejected by druntime atomics.
- Rejects MemoryOrder.acq_rel in atomicLoad and atomicStore.
- Rejects MemoryOrder.acq in atomicExchange.
These are rejected as an invalid memory models if ever encountered
compiling with GDC or LDC, so make it also rejected by druntime atomics
The parser now always creates AST nodes for default init expressions
like __FILE__. They are replaced in resolveLoc. Variable inDefaultArg
in Scope is used, so the nodes are not replaced too early.
- Move code for `_d_newarraymTX` to `core.internal.array.construction`
- Remove `_d_newarraymiTX` and `_d_newarraymOp`
- Add unittests for `_d_newarraymTX`
- Move lowering to `_d_newarraymTX` to the semantic phase
- Inline the lowering when inlining `NewExp`s
- Add changelog entry about the new hook
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
* 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
This follows PR #15415 which added Intel CET IBT support and
LDC PR #4437 to add support for the new CET target in order
to maintain a common interface between DMD and LDC.
Later it would be useful to do the same for GDC as well.
[stable] Make enum function a deprecation, not an error
Signed-off-by: Dennis <dkorpel@users.noreply.github.com>
Signed-off-by: Vladimir Panteleev <CyberShadow@users.noreply.github.com>
Signed-off-by: Petar Kirov <PetarKirov@users.noreply.github.com>
Merged-on-behalf-of: Vladimir Panteleev <CyberShadow@users.noreply.github.com>
Static variables used in a default argument context are now emitted using
their fully qualified name. This is to avoid generating ambiguous
assignments, for instance:
```
struct S
{
__gshared int param;
void example(int param = S.param);
}
```
In the above example, the visitor for dtoh VarExp will omit the `S`
parent, as the static field is nested in `S`.
```
void example(int param = param);
```
Although D understands that `param` refers to the static field, this is
not the case in C++, and the compilation will fail with:
```
error: parameter 'param' may not appear in this context
```