Commit graph

39388 commits

Author SHA1 Message Date
Ben Jones
c6286ab558 backend: use el_scancommas to skip over OPcomma chains 2024-05-02 01:52:26 +02:00
dokutoku
748fab1e02
Fix some invalid links (#16424)
Co-authored-by: dokutoku <3729541-dokutoku@users.noreply.gitlab.com>
2024-04-30 10:20:07 +03:00
Nick Treleaven
f1621176ef Add tests for bug-prone EmptyStatements
Related: https://github.com/dlang/dmd/pull/15409.
2024-04-30 01:23:13 +02:00
Sönke Ludwig
78e4d93498 Fix linker symbol clash for Android libc++.
This adjusts the constructor to be extern(D), analogous to the other C++ exception class definitions.

See ldc-developers/ldc#4634
2024-04-29 23:27:50 +02:00
Dennis
b84fa4709f
Fix 22977 - can escape scope pointer returned by nested function (#14236) 2024-04-29 15:50:02 +03:00
Adam Wilson
4414c2aeaa
Exclude MSVC-* on Ubuntu (#16423)
Removes the Ubuntu/MSVC builds from the GitHub Actions as MSVC is obviously not supported on Ubuntu but it still runs the tests. This should reduce the CI resources and failure modes.
2024-04-29 11:37:27 +08:00
Nick Treleaven
e60bfd11bd
Fix Bugzilla 24434 - Casting away const with cast() is not a @safe lv… (#16315)
* Fix Bugzilla 24434 - Casting away const with cast() is not a @safe lvalue

* Use `pointerTo`

* Use cast to hide lvalue append error

* Fix unsafe shared increment

* Use setUnsafePreview

* Add test for lvalue assign

* Fix qualifier cast check

* Workaround for safe append

Fixes Bugzilla 23530 - casting immutable away allowed in safe.

* Update header

* Trigger tests
2024-04-28 22:44:48 +08:00
Walter Bright
ca7ee01a53 builtins.d: use arrays instead of pointers 2024-04-28 07:07:08 +02:00
Walter Bright
4f21ff1fc5 escape.d: change Scope* to ref Scope 2024-04-28 07:06:56 +02:00
Dennis Korpel
c72c59a184 Remove unneeded @trusted annotations 2024-04-27 14:56:27 +02: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
Dennis Korpel
82f9402b6c Mark some functions @safe or @trusted 2024-04-27 00:43:22 +02:00
Dennis
9ffa763540
escape.d: Refactor EscapeByResults more (#16416)
escape.d: Refactor `EscapeByResults` more

Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Merged-on-behalf-of: Dennis <dkorpel@users.noreply.github.com>
2024-04-26 13:15:04 +02:00
Dennis
e3ffb40283
escape.d: use callbacks for escapeByXXX instead of arrays (#16412)
* escape.d: use callbacks for escapeByXXX instead of arrays

* Fix null access
2024-04-26 12:55:50 +03: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
Iain Buclaw
5ce50ede24
Merge pull request #16409 from ibuclaw/merge_stable
merge stable
2024-04-26 07:09:00 +02:00
Walter Bright
f1d38e40cc
add const to toHash() overrides (#16414) 2024-04-25 17:57:35 -07:00
richard (rikki) andrew cattermole
011b2d3cd2 Fix lookup of ImportC character tables 2024-04-25 23:55:39 +02:00
Iain Buclaw
259e582f46 Merge remote-tracking branch 'upstream/stable' into merge_stable 2024-04-25 19:11:19 +00:00
Iain Buclaw
18d8071103 bump VERSION to v2.108.1-rc.1 2024-04-25 17:53:57 +00:00
Dennis Korpel
6c501f3e51 Fix Bugzilla 24519 - compiler segfault on default argument with slice operator [] 2024-04-24 22:38:54 +08:00
Dennis
1da572ac2e
Fix bugzilla 23657 - [REG2.101] Incorrect error escape reference to stack allocated value (#16407)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
2024-04-24 14:35:43 +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
Dennis
d1f97b31d1
Merge pull request #16406 from dkorpel/merge-stable
Merge stable
2024-04-23 16:24:04 +02:00
Dennis Korpel
33c32407c0 Merge branch 'stable' into merge-stable 2024-04-23 14:44:01 +02:00
Dennis
111ae7308b
Bugzilla issue 24518 - disable GH action coverage checks (#16404) 2024-04-23 09:17:57 +02: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
Jonathan M Davis
757ba61fea Fix bugzilla issue 24517: druntime tests crash on FreeBSD 14
FreeBSD 14 changed the signature of qsort_r to be POSIX-compliant with
POSIX, making it so that our binding for it no longer matches, resulting
in a crash when it's used.

This implements a fix similar to what the FreeBSD headers do to avoid
breaking code (they provide a static inline extern(C++) overload for the
old signature). This provides a deprecated extern(D) overload for the
old signature. The extern(C) overload now matches the new signature. The
changes have been versioned so that they only affect FreeBSD 14 and
newer.

Technically, if someone used Cmp when declaring their function for
qsort_r, this would still break them (though with a compilation error
that should be easy to fix rather than silent breakage or a crash), but
I don't really see a way around that, and Cmp is not part of the POSIX
API, so no one would have a clue that it was a thing without digging
through the bindings. Arguably, we should make it private, since it's
not part of POSIX, but I haven't done anything with that in this commit.
My guess is that in reality, no D programs are both written to use
qsort_r and run on FreeBSD (outside of the druntime tests), but this
way, they won't break unless they use Cmp to declare their comparator
function. They'll just get a deprecation message that they should update
their code.

Regardless, we have to change the signature for FreeBSD 14 for it to
work, and this does that.
2024-04-22 17:16:36 +02:00
Dennis
499a85100a
Limit the number of deprecation messages by default (#16403) 2024-04-22 22:28:07 +08:00
Walter Bright
c09adbbc27
generalize isBorrowedPtr and isReadonlyPtr (#16402) 2024-04-20 23:22:19 -07:00
Ferhat Kurtulmuş
d61f72cbdc
Fix bugzilla 24509: importC cannot handle _stdcall Function Calling … (#16392)
* Fix bugzilla 24509: importC cannot handle _stdcall Function Calling Convention with single heading underscore
2024-04-21 11:30:22 +08:00
Harry Gillanders
978a26dd3d Fix Bugzilla Issue 24511 - __stdcall functions from C are extern(C) in D. 2024-04-21 11:27:26 +08:00
Tim Schendekehl
f1307d6c75
Fix bugzilla 24498 - Multidimensional array not scanned by GC (#16400)
For expression `new int[][][](2, 2)` the relevant element type is
`int[]` and not `int`, because only two dimensions are allocated.
2024-04-19 22:13:27 +02: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
Martin Kinkelin
ec25e56a93 Fix bugzilla 24505 - ImportC: Don't generate symbols for #undef'd macros 2024-04-19 06:50:23 +08:00
Dennis
dc37b90ffe
dtoh: emit _d_dynamicArray only when needed (#16397) 2024-04-18 14:36:28 +02:00
Jonathan M Davis
ded14a2bb9
Fix bugzilla issue 24493: FreeBSD_14 version identifier missing (#16368)
Apparently, there were two problems that needed fixing.

1. The code for the FreeBSD_14 version identifier had not been added
   yet.

2. The build did nothing to detect the version of FreeBSD, which makes
   it very easy to build for the wrong version. The CI apparently sets
   the version - e.g. TARGET_FREEBSD13 - but unless one of those
   TARGET_FREEBSD* versions is set, the build defaults to FreeBSD 11,
   which isn't even supported any longer.

So, this adds the code for the FreeBSD_14 identifier, and it makes it so
that the build queries the OS version on FreeBSD if TARGET_FREEBSD* has
not been set. So, anything that sets the TARGET_FREEBSD* version when
building will control the target version as before, but if it's not set,
then it will target whatever the current system is.
2024-04-18 14:40:20 +03:00
RazvanN7
9ca4c29549 Fix Bugzilla Issue 24479 - [REG2.104] Error on getAttributes on getOverloads of templates 2024-04-18 16:00:04 +08:00
Nick Treleaven
dca92a75b7
[editions] Make body after contract an error (#16382)
* [editions] Make `body` after contract an error

* Mention --help in build.d module comment

* Add ASTBase.Module.edition property, always Edition.legacy for now
2024-04-18 10:26:20 +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
Walter Bright
75dca527f9
add DIP info to obj.d (#16389) 2024-04-16 21:27:54 +02:00
Walter Bright
9a86c4e06c
add find_files() to common/file.d (#16365) 2024-04-15 16:53:37 -07:00
Walter Bright
d434acd8ed
fix bugzilla Issue 21923 - @live does not take destructor code into account (#16371) 2024-04-15 14:46:23 -07:00
Matheus C. França
b31aa942a2
fix: mmap64 error (#16361)
ref.: https://git.alpinelinux.org/aports/tree/community/ldc/lfs64.patch
2024-04-15 19:39:11 +02:00
Walter Bright
274eec89f4 some conversion to foreach 2024-04-15 03:39:12 +02:00
Walter Bright
b8e9322fef remove some 32 bit legacy 2024-04-14 18:00:10 +08:00
Walter Bright
77f640dcd0 use ref for el_copytotmp() 2024-04-14 12:23:29 +08:00
Walter Bright
1a5b706a92 use ref in el_parent() 2024-04-14 12:22:55 +08:00
Walter Bright
8275958d10 make el_const() @safe 2024-04-14 09:16:31 +08:00
Walter Bright
a858ef5d85 use ref in eltonear() 2024-04-14 09:15:51 +08:00