Commit graph

40460 commits

Author SHA1 Message Date
Dennis
1b34fea478
Fix #21179 - Failure to convert const(T) to T after type is used in cast() (#21201) 2025-04-11 05:05:48 +08:00
Martin Kinkelin
bb25d82a3b
build.d: Fix dependencies on generated string-import files (#21192)
This is just a byproduct of taking a closer look at this code,
as part of investigating the recent CI failures on Windows, where
the VERSION and SYSCONFDIR.imp rules seem to run twice - and then
fail for the 2nd run, Windows complaining about another process using
the file. I guess that could be an Anti-malware process running right
after creating the file the first time. And both rules check the file
contents as part of their condition, so if the rule is processed twice,
we try to immediately read its contents after the write.

Each of these 2 auto-generated files is string-imported exactly once:

* `SYSCONFDIR.imp` in the driver's `dmd/dinifile.d` (and actually on
  Posix only)
* `VERSION` in the lexer's `dmd/globals.d`

I've revised the deps accordingly, which might avoid processing these
rules multiple times as a side-effect.
2025-04-11 05:03:54 +08:00
Dennis
0aee4697bd
Fix #21189 - wrong/missing error line when source file isn't regular (#21190) 2025-04-10 07:19:58 +08:00
drpriver
3070fc288a
ImportC: undefined identifier _Float16 (#21184)
Fixes: https://github.com/dlang/dmd/issues/21183

The previous MR put the macro in a `#if linux` which meant it
didn't actually solve the problem of being unable to
`#include <math.h>` on macos. So put it in a better spot.

Also enable the test that includes that header for macos so that
it stays solved.
2025-04-09 14:05:05 +08:00
Iain Buclaw
51816cd01d fix #21153 - [REG 2.111.0] Infinite loop in isAliasThisTuple
Partially reverts the regressing change in 08901365d4. The "fixed"
refactoring should be applied to master/development branch.
2025-04-08 16:27:08 +02:00
Rainer Schuetze
ce16000c48
remove duplicate dependency on versionFile and sysconfDirFile, lexer already has it (#21164) 2025-04-08 07:12:12 +08:00
Denis Feklushkin
21b6202f54
fix compilation of ucontext_t-based fibers (#21156) 2025-04-06 20:08:02 +08:00
Iain Buclaw
a6b3751b19
fix #21153 - [REG 2.111.0] Infinite loop in isAliasThisTuple (#21154) 2025-04-06 07:31:30 +08:00
Martin Kinkelin
ed17b3e95d
Fix #21098 (#21132)
By reverting #10718 - it seems superfluous nowadays?
2025-04-02 07:42:03 +08:00
Martin Kinkelin
dbe0ddbde6
[stable] build.d: Fix VERSION fallback if git describe fails (#21133)
* build.d: Fix VERSION fallback if `git describe` fails

Which can fail for *shallow* git clones, as used for GitHub Actions.

* [apply to config.d as well; e.g., used by Visual Studio project]
2025-04-01 22:10:37 +02:00
Dennis Korpel
c6863be720 purge changelog 2025-03-31 13:33:57 +02:00
Dennis Korpel
c403accecf bump VERSION to v2.111.0 2025-03-31 12:17:24 +02:00
Dennis
8dcef66a5f
Revert "Fix #21024 - Optimize x^^c expressions (#21082)" (#21114)
This reverts commit fa1f860e4b.
2025-03-29 12:25:53 +01:00
Fares A. Bakhit
fa1f860e4b
Fix #21024 - Optimize x^^c expressions (#21082)
* Fix #21024 - Optimize x^^c expressions

Reason for the *magic* constraint c<8 on inlining x^^c:

https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/x86_64/fpu/e_powl.S;h=47f129f34d368d7c67b8e5f2462b36b0bebb7621;hb=HEAD#l136

* Fix poor assumption about expression state

* Restrict optimization to floating point expressions

* Generalize optimization to any scalar data type

* Fix segfault on x^^c where x is a single member anonymous enum

DMD segfaulted on compiling the unittests in std/algorithm/sorting.o, the
unittest that caused the segfault can be reduced to:

    enum real Two = 2.0;
    auto _ = Two^^3;

I'm not sure why copying the anonymous enum into a `const` variable causes
the compiler to segfault.

* Add tests to x^^c inlining optimization

* Fix missing type for e1 ^^ -1 to 1 / e1 rewrite

* Move rewrites from constant folding to expression semantic and restrict them to [-1, 2]

* Improve error message for the x^^2 rewrite.

Before:
    ex.d(4): Error: can implicitly convert expression `(const const(double) __powtmp2 = x + 5.0;) , __powtmp2 * ...` of type `double` to `int`
        int y = ( x + 5 ) ^^ 2;
                ^
and after:
    ex.d(4): Error: cannot implicitly convert expression `(x + 5.0) ^^ 2L` of type `double` to `int`
        int y = ( x + 5 ) ^^ 2;
                ^

* Update C++ frontend header to match change in `CommaExp`

* Address code review feedback

Co-authored-by: Dennis Korpel <dkorpel@gmail.com>

---------

Co-authored-by: Dennis Korpel <dkorpel@gmail.com>
2025-03-29 12:13:38 +01:00
Fares A. Bakhit
d65a100b6c
Update source code and coverage links (#21111) 2025-03-29 10:57:56 +08:00
Iain Buclaw
02a64d2e13
Fix #21045 - import __stdin causes compilation to pause while reading from stdin (#21047)
Moves the special handling of reading from stdin out of the semantic
routines to the DMD driver itself. All references to `__stdin.d` have
also been removed from the frontend implementation.
2025-03-22 13:00:35 +01:00
Dennis Korpel
032e24446b bump VERSION to v2.111.0-rc.1 2025-03-21 20:27:52 +01:00
Dennis
9d2f034398
Improve UFCS/property error message (#21046) 2025-03-21 15:15:29 +01:00
Iain Buclaw
94950cae58
Add C++23 to CppStdRevision enum (#21043) 2025-03-21 08:29:14 +08:00
Martin Kinkelin
8db14cf846
Fix #21020 - Indexing a *cast* AA yields no lvalue anymore (#21029) 2025-03-19 07:15:23 +08:00
Martin Kinkelin
6d57da76e4
druntime: Add module declaration to rt.invariant, to prevent conflicts with user-provided invariant.d (#21017) 2025-03-18 07:42:46 +08:00
Martin Kinkelin
fde0f8c40a C++ headers: Add 3 Declaration bitfield setters/getters required by LDC 2025-03-17 15:30:21 +01:00
Iain Buclaw
7f22e651ed
[stable] C++ header fixes for declaration, expression, and typinf (#21016)
Seen either from compilation errors or missing symbols at link time.
2025-03-17 22:19:12 +08:00
Iain Buclaw
8c9769fef4
Expose SourceLoc to C++ interface (#20980) 2025-03-17 22:17:16 +08:00
Martin Kinkelin
d2ee11364c
druntime: Fix compilation of rt.cover on Android (#21015) 2025-03-17 15:06:24 +01:00
Dennis
57a60e575c
Move genCfunc to cxxfrontend (#20992) 2025-03-17 06:40:49 +08:00
Dennis
d5e6f49098
Fix #20982 - wrong line number in iasmgcc (#20993) 2025-03-15 20:16:44 +01:00
Dennis
51be8bb729
memoryerror.d: Fix AnySupported version condition (#20983) 2025-03-14 07:13:44 +08:00
Manu Evans
603225372b Accept __rvalue attribute on ref functions; which will force the result to be treated as __rvalue. (#20946)
This is essential to implement `move`, `forward`, etc.
2025-03-11 14:12:06 +10:00
Dennis Korpel
c6e387c448 bump VERSION to v2.111.0-beta.1 2025-03-09 17:10:49 +01:00
Dennis Korpel
ed78e9d300 Merge remote-tracking branch 'upstream/master' into stable 2025-03-09 17:10:21 +01:00
Walter Bright
4ad88c4b11
successfully run exe1.c elemi() test (#20969) 2025-03-09 16:39:25 +08:00
Walter Bright
d1f5972b54
getting first two tests in exe1.c to run (#20968) 2025-03-08 22:49:35 -08:00
Walter Bright
8812065e8b
fix #20960 i = i && 1; fails at runtime (#20961) 2025-03-07 11:42:12 +08:00
Walter Bright
4c4b9aef4d
detab source code (#20962) 2025-03-07 10:31:19 +08:00
Walter Bright
42619075eb
add exe1.c to test suite (#20957) 2025-03-06 12:25:59 -08:00
Walter Bright
b02be83f5c
fix 64 bit Arm relocations (#20951) 2025-03-06 12:24:21 -08:00
Dennis
4661fec6b7
Update copyright years to 2025 (#20958) 2025-03-06 18:17:32 +08:00
Matthew Qiu
325ef115e8
Move ClassDeclaration.vtblSymbol to dsymbolsem (#20956) 2025-03-06 16:02:40 +08:00
Matthew Qiu
57e7419c4d
Moved StaticForeach.lowerArrayAggregate to expressionsem (#20955) 2025-03-06 15:59:41 +08:00
Quirin F. Schroll
cc6f184a66
Improve placement new changelog entry (#20954) 2025-03-06 15:58:46 +08:00
Dennis Korpel
5ed96a59b3 purge changelog 2025-03-05 15:33:12 +01:00
Dennis Korpel
d5fa6e0629 bump VERSION to v2.110.0 2025-03-05 12:28:07 +01:00
Nicholas Wilson
ee6449ded0
Merge pull request #20952 from dkorpel/merge-stable
Merge stable
2025-03-05 19:00:22 +08:00
Dennis Korpel
5375db4f76 Merge branch 'stable' into merge-stable 2025-03-05 11:03:30 +01:00
Matthew Qiu
6df52b0ef2
Move ClassDeclaration.isFuncHidden to dsymbolsem (#20945) 2025-03-05 16:18:53 +08:00
Matthew Qiu
bc4c7e4452
Move Dsymbol.hasStaticCtorOrDtor to dsymbolsem (#20943) 2025-03-05 06:23:33 +08:00
Walter Bright
ddc7eaf570
another pass over movParams() (#20949) 2025-03-04 18:39:08 +08:00
Walter Bright
eb95108dfb
2nd go at funccall() for AArch64 (#20948) 2025-03-04 17:06:41 +08:00
Matthew Qiu
58d3b59dc5
Moved Staticforeach.lowerNonArrayAggregate and Staticforeach.prepare to expressionsem (#20944) 2025-03-04 17:05:02 +08:00