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
```
* 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>
* rt.minfo: Avoid calling realloc with size 0
This is not portable, and memcheck complains about this.
* Add C Valgrind API
Add the BSD-licensed C header files which provide the API for
controlling Valgrind from within programs executed under it.
The files are from Valgrind v3.21.0.
* Add some D bindings for the Valgrind C API
We will use these in the GC implementation to tell Valgrind which
memory operations are OK or not.
* Silence Valgrind warnings caused by GC marking
Allow the conservative GC to scan memory, whether it has been
initialized by the application or not.
* Add test suite for Valgrind
* Unify VALGRIND with MEMSTOMP
The two share the same goal: mark memory which should not be accessed
any more.
* Mask "invalid" access to free lists
The GC stores free lists in the cells of the objects on the list.
We would like to allow the GC to work with these lists, but still
raise a warning if application code attempts to access them.
* Distinguish between writable and unwritable invalidation
Freshly allocated memory should be writable but not readable.
Explicitly deallocated or GC-ed memory should be neither readable or
writable.
* Add use-after-free test
* Invalidate freshly-allocated memory
* Integrate VALGRIND with SENTINEL
* Fix reporting of arrays of structs with destructors
* Re-invalidate reused blocks during malloc/calloc
* Add Changelog entry
* .pre-commit-config.yaml: Exempt vendored files
* etc.valgrind.valgrind: Propagate return values of the vbits functions
* etc.valgrind.valgrind: Add documentation for functions
Copy/adapt the documentation in memcheck.h.
* druntime/test/valgrind: Add no_use_after_gc test
* ci/cirrusci.sh: Install Valgrind on Linux
Run the Druntime Valgrind integration tests.
libc6-dbg is needed to allow Valgrind to redirect certain functions.
* etc.valgrind.valgrind: Add @nogc
Although the GC is the primary user, this is not a restriction of
these Valgrind API wrappers.
* druntime/test/valgrind: Fix no_use_after_gc test with -release
Trick the optimizer to pretend we're doing something with the result
of those invalid memory accesses.
* Fix Issue 12118 - Modify immutable data using throw
* Change immutable test to const
* Deprecate throwing any qualified type
* Allow throw shared as std.concurrency does that
* Use static this instead of static const for test
* Only allow single shared qualifier or none
* Add changelog
* Disallow throwing shared objects too
* Update changelog/dmd.throw-qualifier.dd
Co-authored-by: Razvan Nitu <razvan.nitu1305@gmail.com>
---------
Co-authored-by: Razvan Nitu <razvan.nitu1305@gmail.com>
This error was introduced in `-preview=in` in v2.101.0.
In order to make `-preview=in` the default, we add a deprecation
even if `-preview=in` is not used.