Commit graph

656 commits

Author SHA1 Message Date
Nick Treleaven
23f6757be9
Add changelog for #16334 (#16470) 2024-05-10 17:03:18 +02:00
Dennis
109dddb649
Fix error message in deprecation-limit.dd (#16471) 2024-05-10 17:02:53 +02:00
Walter Bright
0466791297
bitfields: add bitoffsetof, bitwidth, isBitfield (#16444) 2024-05-08 14:59:34 +03:00
Dennis
62e5e9f1af
Merge pull request #16422 from rikkimax/kill-omf
Kill off OMF support
2024-05-07 18:24:23 +02:00
zopsicle
5eb426e588 Add module core.sys.linux.sys.mount
The new module core.sys.linux.sys.mount provides definitions corresponding to
those in the header <sys/mount.h> on Linux.
2024-05-07 02:02:11 +02:00
richard (rikki) andrew cattermole
ad6e0c7a27 Kill off OMF support 2024-05-03 18:24:36 +12:00
Nick Treleaven
32e4910ab3
Make foreach_reverse with a delegate an error (#16418)
* Make `foreach_reverse` with a delegate an error

Deprecation goes back to at least 2016:
68fb91a130 (diff-13f50d9dea67df89a0535d6b8957f3145d49f71f6b72fdd3913f329a265e1423R1155)
2024-04-27 20:25:20 +08:00
chloekek
ab7f6e65a5
Mark Thread.sleep as @trusted (#16411)
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.
2024-04-26 10:57:35 +03:00
Dennis
49c4afd93f
Demangle symbols in linker errors (#16021)
* Demangle symbols in linker errors

Fix bugzilla issue 5573

* Fix test output regex of needspkgmod

---------

Co-authored-by: Dennis Korpel <dennis@sarc.nl>
2024-04-24 14:35:14 +03:00
Steven Schveighoffer
aec16d889c
Remove the interface function fullCollectNoStack from the gcinterface (#16401)
* 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
2024-04-23 15:06:21 +08:00
Dennis
499a85100a
Limit the number of deprecation messages by default (#16403) 2024-04-22 22:28:07 +08:00
Nick Treleaven
56a0ea80b1
Fix Bugzilla 14128 - AliasDeclaration allows expressions, causing false … (#15863)
* 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
2024-04-19 17:55:31 +03:00
Dennis
3b3d496210
dtoh: export extern(Windows) and extern(System) functions (#16394)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
2024-04-18 10:09:52 +03:00
Iain Buclaw
f2b61e6c48 Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-04-01 20:58:54 +00:00
Iain Buclaw
b65767825f purge changelog 2024-04-01 20:12:39 +00:00
Johan Engelen
92181d3c0d
Implement __ctfeWrite builtin (#16250)
* 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.
2024-03-18 11:26:29 -07:00
Richard (Rikki) Andrew Cattermole
dffd899508
Implement UAX31 character ranges (#15307) 2024-03-18 11:19:16 -07:00
Iain Buclaw
2a7a9c459a
Merge pull request #16293 from dkorpel/hexstring-impl-conv-stable
[stable] Make hex strings implicitly convert to integer arrays
2024-03-15 09:41:59 +01:00
Dennis Korpel
4e3cc5c6c6 Make hex strings implicitly convert to integer arrays 2024-03-15 08:53:48 +01:00
Dennis
310a2d7ea6
Add changelog for named arguments (#16262) 2024-03-13 14:36:29 +02:00
Dennis Korpel
3e9bc4ee17 Add L postfix for hex string 2024-03-06 11:48:45 +01:00
Iain Buclaw
6343e32705 Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-02-02 10:00:55 +00:00
Iain Buclaw
44ef2773be purge changelog 2024-02-02 10:00:49 +00:00
Dennis
d396a5ae84
Fix bugzilla issue 24363 - hex string postfixes are useless (#16118)
* Fix bugzilla issue 24363 - hex string postfixes are useless

* Mangle invalid strings as arrays
2024-01-31 13:44:43 +01:00
Iain Buclaw
b514d89f9e Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-01-28 00:17:46 +00:00
Dennis
ba5402e7ac
Allow casting hexstring to int array (#16079) 2024-01-25 10:02:04 +01:00
Adam D. Ruppe
d8dcb940ab
Enhanced version of dip1036 implementation (#15715)
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.
2024-01-19 22:21:40 -08:00
Iain Buclaw
a8259d353f core.atomic: Reject invalid failure memory modules in compare exchange
- 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.
2024-01-17 14:42:29 +01:00
Iain Buclaw
92f1c2b498 core.atomic: Reject invalid memory models in load, store and exchange
- 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
2024-01-17 00:18:05 +01:00
Walter Bright
d91e03511f
compare class name signatures (#16032) 2024-01-15 22:26:47 -08:00
Tim Schendekehl
33286cccd8
Fix issue 18919 - __FILE__ and __LINE__ should work when used in default argument expressions (#15968)
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.
2024-01-07 23:57:48 +01:00
Nick Treleaven
dea9e0e586
Deprecate string literals as (static) assert conditions (#15860)
* Deprecate string literals as assert conditions

Fix Issue 14387 - Disallow string literals as assert conditions

* Avoid running expression semantic, only deprecate literals

Ignore enum strings.

* Fix runnable test
2023-12-29 18:10:55 +01:00
Dennis
14ecea9ea7
Add @standalone attribute for module constructors (#15537)
* Add `@__standalone` attribute

* Remove underscores from __standalone
2023-12-22 11:03:03 -08:00
Martin Kinkelin
cf9df8437c Makefiles: Add comments wrt. usage on Windows and a few example invocations 2023-12-18 07:29:32 +08:00
Martin Kinkelin
7914f70da8 Add changelog entry 2023-12-18 07:29:32 +08:00
Martin Kinkelin
254de93ac8 Makefile: Include druntime in install target 2023-12-18 07:29:32 +08:00
Martin Kinkelin
fa9731559a Add changelog entry 2023-12-12 01:32:21 +01:00
Adam D. Ruppe
2d42fdbcf8 make pragma great again 2023-12-08 15:07:33 -05:00
richard (rikki) andrew cattermole
2625a1607c Initial attempt at stdatomic.h 2023-12-08 12:45:28 +01:00
Iain Buclaw
b932359777 Merge remote-tracking branch 'upstream/stable' into merge_stable 2023-12-02 13:56:46 +00:00
Iain Buclaw
724e0051bb purge changelog 2023-12-02 13:56:36 +00:00
Teodor Dutu
055accfbe6
Translate _d_newarray{mTX, miTX, Op} to a single template (#15819)
- 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>
2023-11-17 09:57:30 +02:00
Teodor Dutu
265a72629c
changelog: Describe the template _d_newarrayT (#15729)
Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
2023-10-30 16:20:34 +02:00
Dennis
243aaef2f8
Fix 23103 - static initialization of associative arrays is not implemented (#15468)
* 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
2023-08-31 15:18:22 +02:00
Ernesto Castellotti
a2695d8822
Add Intel CET to getTargetInfo (#15433)
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.
2023-08-27 10:35:41 +02:00
Walter Bright
622a432974
fix Issue 24084 - Add -nothrow Switch to Compiler (#15536) 2023-08-17 17:28:56 -07:00
Nick Treleaven
b677368227 [stable] Make enum function a deprecation, not an error (#15533)
[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>
2023-08-15 23:23:08 +01:00
Iain Buclaw
6fee5868f2 dtoh: Always refer to default arguments using their FQN.
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
```
2023-08-04 07:51:19 +08:00
Nick Treleaven
3f572825e6 Add changelog for #15493 2023-08-04 01:49:57 +02:00
Iain Buclaw
e7932f2c02 Merge remote-tracking branch 'upstream/stable' into merge_stable 2023-08-01 23:22:42 +00:00