Commit graph

1155 commits

Author SHA1 Message Date
Andrey Penechko
ec7c24bb72
Add test cases for static arrays initialization with hex string (#20738) 2025-01-19 21:13:58 +08:00
Dennis
ac9e8a5a70
Fix bypassing nothrow in debug statements (#20720)
* Fix bypassing nothrow in debug statements

* Fix debug walking null statements
2025-01-17 01:50:17 +01:00
Dennis
803db11017
Re-enable tests of temporary in condition and throwing callee (#20721) 2025-01-16 23:35:13 +01:00
Dennis Korpel
a78abc4328 Improve error locations when lexing number literals 2025-01-16 22:05:21 +01:00
Dennis
888917669c
Remove debug() / version() integers (#20713) 2025-01-16 15:20:06 +08:00
Dennis
20090aba96
Make inferred attribute failure errors more compact and consistent (#20711) 2025-01-16 01:42:05 +01:00
Dennis
3daeb3a33d
Improve diff based AUTO_UPDATE (#20703)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
2025-01-15 23:25:32 +01:00
Walter Bright
10eb368c1b fix #20686 infer attributes for generated functions 2025-01-12 19:29:12 +08:00
Dennis
b237d0329c
Fix ambiguous type deduction around hex strings (#20679) 2025-01-10 23:35:51 +01:00
Walter Bright
eb8418a772
build default move constructors (#20634) 2025-01-10 11:19:29 -08:00
Dennis Korpel
8b215f8c16 Fix missing backtick in escape.d error message 2025-01-10 17:52:17 +01:00
Paul Backus
99b4a5dc76 Revert "Enable -preview=fieldwise by default"
This reverts commit 6a7bd45a8e.

PR #17495 was originally merged in an incomplete state. Since there are
non-trivial obstacles to completing it, revert the incomplete changes
instead.

See PR #20670 for more information.
2025-01-09 13:38:03 -05:00
Dennis
69664b922d
Merge pull request #20577 from thewilsonator/pointer-subtract
Make subtracting pointers of different types an error
2025-01-09 15:06:33 +01:00
Dennis Korpel
37978248a9 Fix "Casting class references to void* should be @safe" 2025-01-08 23:24:36 +01:00
Nicholas Wilson
8d2fe40f4b Fix #20330 - Make subtracting pointers of different types an error 2025-01-08 15:44:38 +08:00
Dennis
9b94878c85
Make safe error messages consistent (#20654)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
2025-01-08 13:46:38 +08:00
Dennis
1bdea38933
Implement AUTO_UPDATE for multiple TEST_OUTPUT blocks (#20652) 2025-01-08 07:47:51 +08:00
Dennis
95145b4ee7
Fix -verrors=context handling of tabs (#20640) 2025-01-07 14:39:25 +08:00
Dennis Korpel
ec66babbc5 Print match level for ambiguous overloads 2025-01-05 13:28:09 +01:00
Royal Simpson Pinto
45e4a09a3e
feat(errors): enable verrors=context globally (#20576)
Signed-off-by: royalpinto007 <royalpinto007@gmail.com>
2025-01-03 05:17:59 +08:00
Walter Bright
c57da0cf59
fix #20621 Comparing addresses of rvalue reference parameters not correct (#20622) 2024-12-31 17:00:03 +08:00
Nicholas Wilson
9c4694fc11
[run.d] add space between commands for failed unittest (#20628) 2024-12-31 10:48:37 +08:00
Nicholas Wilson
da1b69af37
[run.d] print failed command for failed unit tests (#20620) 2024-12-30 14:07:18 +08:00
Quirin F. Schroll
3f90de47c1
Fixes #20587 - Add align(default) (#20589) 2024-12-30 13:02:14 +08:00
Walter Bright
cc21914461
fix #20614 Add __traits(hasMoveConstructor, type) (#20615) 2024-12-28 22:02:47 -08:00
Walter Bright
1b9bc74edc
fix #20610 aliasing for fields does not work (#20611) 2024-12-27 21:38:25 -08:00
Walter Bright
2c5638e880
replacing string instructions with MOVs (#20582) 2024-12-24 10:39:26 +08:00
Walter Bright
cdc7334e44
fix issue 20562 returning __rvalue should move-construct the NRVO value (#20585) 2024-12-23 13:08:50 +08:00
Walter Bright
bf3f49ac79 optimize s=s where s is a struct 2024-12-18 16:51:23 -08:00
Walter Bright
b7a3a1942c
fix Issue 20567 returning the result of a constructor should be NRVO (#20568) 2024-12-18 00:48:52 -08:00
Walter Bright
85fe931daa
fix github issue 20754 replace a?b:b with a,b when optimized (#20575) 2024-12-17 23:59:42 -08:00
Royal Simpson Pinto
59883ab71e
feat(errors): implement verrors=simple to skip context printing (#20566)
Signed-off-by: royalpinto007 <royalpinto007@gmail.com>
2024-12-18 11:53:37 +08:00
The Dlang Bot
059b1ab407
Merge pull request #20559 from KitsunebiGames/objc
Objective-C Improvements

Signed-off-by: Dennis <dkorpel@users.noreply.github.com>
Signed-off-by: Nicholas Wilson <thewilsonator@users.noreply.github.com>
Merged-on-behalf-of: Dennis <dkorpel@users.noreply.github.com>
2024-12-15 22:48:39 +01:00
Walter Bright
a99a3894be
add __rvalue(expression) builtin (#17050) 2024-12-15 12:13:28 -08:00
Nicholas Wilson
13775eb2d1
Fix #18235 - Add offending member to "no size because of forward reference" error (#20557)
Co-authored-by: Nick Treleaven <ntrel002@gmail.com>
2024-12-15 18:23:36 +08:00
LunaTheFoxgirl
0845895659 Objective-C classes do not have invariants, null check directly. 2024-12-14 19:26:08 +01:00
LunaTheFoxgirl
2aa9f23110 Remove super-call in test 2024-12-14 18:35:42 +01:00
LunaTheFoxgirl
8a7108f8c9 Skip selector-gen for templates 2024-12-14 17:30:26 +01:00
LunaTheFoxgirl
8f1803391c Add newline to test 2024-12-14 16:53:25 +01:00
LunaTheFoxgirl
5b9e712f87 Add test for automatic selector generation 2024-12-14 16:42:39 +01:00
Paul Backus
6a7bd45a8e Enable -preview=fieldwise by default
Introduced in PR #9331, this was changed from a normal bug fix to a
-preview switch because enabling it triggered a suprious "statement is
not reachable" warning in Phobos. That warning has since been removed
(in PR #15568).
2024-12-08 21:19:17 +01:00
Nick Treleaven
a7f6b04a0c
Don't allow short constructor with non-void expression except this() and super() (#17489) 2024-12-08 17:21:42 +08:00
Ilya Yanok
c1343f69f3 Make lambda symbols stable post a3abf1187e
Commit a3abf1187e fixes some cases of
lambdas having unstable symbol names between compilation units by
using `generateIdWithLoc` to generate stable lambda names, however since
LOC doesn't uniquely identify a lambda instance (because templates,
mixins, static foreach and foreach unrolling), `generateIdWithLoc`
adds a counter, so there is still some instability going on.

`generateIdWithLoc` makes the name uniq per file+loc, by adding adding a
numeric suffix. But the order of instantiations might be different
across compilation units, so with this counting scheme we are back to
unstable names, so one module might have

`t!0.__lambda_LOC` and
`t!1.__lambda_LOC_1`

while another one has

`t!1.__lambda_LOC`

This is not a critical problem, but at very least the code gets
duplicated for no reason. I also have an example where it leads to
linking error, but since it's not a small one and fails to minimize
further, I suspect it's a result of interaction with some other bug.

The thing is we don't even need uniqueness for those lambdas inside
templates/mixins: their final names will have the instantiation prefix anyway.
But we can't also just disable this uniqueness check completely: `static
foreach` as well as unrollings of the normal `foreach` with lambdas in
the loop body will have several copies of a single lambda with the same
file+loc. So here we do want to keep making them unique. Fortunately, I
don't think a `foreach` could be iterated in different order in
different compilation units, so hopefully if we limit the counting to
this case only, it won't make symbols unstable.

To implement this idea, I've added an extra `parent` argument to
`generateIdWithLoc`: it works like using `parent ~ prefix` prefix, but
without adding `parent` to the final output.

Fixes since last review:
 1. Changed `fromStringz` to `toDString`
 2. Added a test to showcase the problem
2024-12-07 10:48:34 +01:00
Dennis Korpel
869ed9c6b9 Fix bugzilla 24891 - Two scope attributes emitted as part of .di generation 2024-12-05 15:03:54 +01:00
Dennis Korpel
56eb579a45 Allow shortened method syntax for constructors 2024-12-04 12:16:44 +01:00
Dennis
b076573644
Merge pull request #17102 from yanok/lambda-mangle2
Make lambda symbols stable post a3abf1187e
2024-12-04 11:46:48 +01:00
Ilya Yanok
451c1596be Make lambda symbols stable post a3abf1187e
Commit a3abf1187e fixes some cases of
lambdas having unstable symbol names between compilation units by
using `generateIdWithLoc` to generate stable lambda names, however since
LOC doesn't uniquely identify a lambda instance (because templates,
mixins, static foreach and foreach unrolling), `generateIdWithLoc`
adds a counter, so there is still some instability going on.

`generateIdWithLoc` makes the name uniq per file+loc, by adding adding a
numeric suffix. But the order of instantiations might be different
across compilation units, so with this counting scheme we are back to
unstable names, so one module might have

`t!0.__lambda_LOC` and
`t!1.__lambda_LOC_1`

while another one has

`t!1.__lambda_LOC`

This is not a critical problem, but at very least the code gets
duplicated for no reason. I also have an example where it leads to
linking error, but since it's not a small one and fails to minimize
further, I suspect it's a result of interaction with some other bug.

The thing is we don't even need uniqueness for those lambdas inside
templates/mixins: their final names will have the instantiation prefix anyway.
But we can't also just disable this uniqueness check completely: `static
foreach` as well as unrollings of the normal `foreach` with lambdas in
the loop body will have several copies of a single lambda with the same
file+loc. So here we do want to keep making them unique. Fortunately, I
don't think a `foreach` could be iterated in different order in
different compilation units, so hopefully if we limit the counting to
this case only, it won't make symbols unstable.

To implement this idea, I've added an extra `parent` argument to
`generateIdWithLoc`: it works like using `parent ~ prefix` prefix, but
without adding `parent` to the final output.

Fixes since last review:
 1. Changed `fromStringz` to `toDString`
 2. Added a test to showcase the problem
2024-12-04 11:04:26 +01:00
Dennis Korpel
bfae7828a9 Cache TypeIdExp::semantic 2024-12-03 23:10:11 +01:00
Dennis Korpel
74c40e9be0 Merge branch 'stable' into master 2024-11-29 12:46:40 +01:00
Richard (Rikki) Andrew Cattermole
6567f6f4a4 Fix bugzilla issue 24882 - COM class is allocated using GC not malloc 2024-11-29 08:37:07 +01:00