Commit graph

444 commits

Author SHA1 Message Date
Steven Schveighoffer
935d72a79e Remove unnecessary NoPointersBitmapPayload template. 2025-02-08 03:52:29 +01:00
Dennis
f4558fe0fd
Move toChars overrides to hdrgen.d (#20804) 2025-01-30 23:25:37 +01:00
Dennis
bfbac11136
Don't expose internal names in errors (#20803) 2025-01-30 21:49:50 +08:00
Dennis
096c9c1528
Make delete an identifier instead of keyword (#20745) 2025-01-21 23:33:50 +01:00
Dennis
2a627016f6
Disallow initializing fields with themself (#20696) 2025-01-21 05:49:24 +08:00
Walter Bright
10eb368c1b fix #20686 infer attributes for generated functions 2025-01-12 19:29:12 +08:00
Walter Bright
eb8418a772
build default move constructors (#20634) 2025-01-10 11:19:29 -08: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
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
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
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
Walter Bright
a99a3894be
add __rvalue(expression) builtin (#17050) 2024-12-15 12:13:28 -08: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
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 Korpel
bfae7828a9 Cache TypeIdExp::semantic 2024-12-03 23:10:11 +01:00
Dennis Korpel
1a44210ffb Fix bugzilla 24883 - Speculative template overload error escapes with -preview=rvaluerefparam 2024-11-29 08:36:13 +01:00
Walter Bright
347c883586
Implement Safer D (#17044) 2024-11-27 22:59:29 -08:00
Dennis Korpel
519d388498 Fix bugzilla 24845 - Compiler error when trying to assign to an AA value of an enum instance 2024-11-25 22:54:52 +01:00
Artha
0c09587bd7
Strip one space in /// comments 2024-11-25 08:17:24 +01:00
Dennis
1039b0e93d
Update compiler/test/compilable/ddoc24871.d 2024-11-22 15:17:09 +01:00
Artha
303d95f680
Fix bugzilla issue 24871 - DDoc strips indent in triple slash comments
Removes code in the lexer responsible for removing leading spaces in
triple slash doc comments.

This affects the test file for issue 14413; two more spaces appear, but
they are not significant in the HTML output.
2024-11-22 13:00:05 +01:00
Martin Kinkelin
33e87826df Merge remote-tracking branch 'origin/stable' into merge_stable 2024-11-16 23:31:02 +01:00
Martin Kinkelin
c58e2a766b compilable/stdcheaders.c: Work around unsupported NAN in new WinSDK headers
GitHub Actions upgraded the WinSDK in the latest image, and its NAN is
apparently not supported by ImportC anymore, breaking CI.
2024-11-16 22:08:33 +01:00
Martin Kinkelin
72b2fbe64a Merge remote-tracking branch 'origin/stable' into merge_stable
Conflicts:
	compiler/src/build.d
	compiler/src/dmd/dcast.d
	compiler/src/dmd/dtemplate.d
	compiler/src/dmd/expressionsem.d
2024-11-16 16:09:17 +01:00
Dennis Korpel
f6115f0335 Fix bugzilla 24855 - VRP fails to prevent overflow after division 2024-11-13 01:49:06 +01:00
royalpinto007
dc5f8db05c feat(errors): consolidate multiple sarif reports into a single report
Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): buffer size

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): diagnostics array

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): repeated sarif blocks in errors.d and sarif.d

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): pre-commit checks

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): circleci build

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): Ddoc comments and docs

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): plugSink function by adding early return for empty diagnostics

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): remove unnecessary change

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): global array initialisation

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): separate formatting message

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): dDoc comments

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>
2024-11-11 14:38:46 +08:00
Richard (Rikki) Andrew Cattermole
a7c85ec3be Fix bugzilla issue 24846 - atomicLoad does not work for class arguments with -preview=nosharedaccess 2024-11-11 05:39:57 +08:00
royalpinto007
7c8e8ec2e5 feat(errors): generate sarif report on successful execution
Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): tests dDoc, implicit conversion

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): implicit conversion

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): brace, default parameters, invert if-else

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): pre commit checks

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): arguments

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): va_list

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): imports

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): imports

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): va_list

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): va_list

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(errors): va_list passing

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(tests): arg placement

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(regex): Add custom regex-like parsing for version extraction

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(regex): Add custom regex-like parsing

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>

fix(regex): version with regex, remove custom regex parser

Signed-off-by: royalpinto007 <royalpinto007@gmail.com>
2024-11-06 23:36:30 +01:00
bangbangsheshotmedown
c1a753bca3
Fix bugzilla issue 24153 - Inliner breaks -betterC by requiring TypeInfo (#17049) 2024-11-03 15:35:32 +08:00
Ilya Yanok
ad9190104f dsymbolsem/InstMemberWalker: also visit generated structs' members
While updating children's `minst` only going over `members` is not
enough: structs may also have generated methods that are not in
`members`.

As a result, if a generated method instantiates a template, it gets a
poentially wrong `minst`, so can be omitted from the compilation result.

Fixes Bugzilla Issue 24830.
2024-10-24 00:40:15 +02:00
Nicholas Wilson
57c5b071af
Rebase stable6 (#16967)
* Document template instance duplication status as part of its field documentation. (#16643)

* Fix Bugzilla 24599 - Wrongly elided TypeInfo emission (#15868)

Reverting #14844, which caused such missing TypeInfos, *and* making
sure the special TypeInfo members are fully analyzed and ready for
codegen (otherwise hitting an assertion for the real-world project).

* Reorganize backend build files to match target and make more similar per line (#16672)

* Remove redundant suggestions on linker errors (#16711)

* Fix bugzilla 24337 - Segfault when printing an int[] cast from a string (#16729)

* Add BitFieldStyle.Gcc_Clang_ARM

Required for 32-bit ARM, and non-Apple 64-bit ARM targets.

The only difference to `Gcc_Clang` is that anonymous and 0-length
bit-fields do contribute to the aggregate alignment.

Caught by existing proper C interop tests in
runnable_cxx/testbitfields.d on such targets. The hardcoded bad tests
in runnable/{bitfieldsposix64.c,dbitfieldsposix64.d} however now fail
after the fix, on such targets again.

* [refactor to `TargetC.contributesToAggregateAlignment(BitFieldDeclaration)` hook]

* Fix Bugzilla Issue 24687 - [REG2.110] Cannot cast string-imports to select overload anymore

* Also make deprecationSupplemental adhere to error limit (#16779)

Co-authored-by: Dennis Korpel <dennis@sarc.nl>

* Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing template bool argument

* Fix bugzilla 24731 - IFTI cannot handle integer expressions (#16822)

* Fix Bugzilla Issue 24760 - ICE on variadic after default argument

* Fix bugzilla 24790 - -vcg-ast ICE on lowered assign exp (#16914)

Co-authored-by: Dennis Korpel <dennis@sarc.nl>

* Fix bugzilla 24764 - ICE when -vcg-ast prints imported invariant (#16917)

Co-authored-by: Dennis Korpel <dennis@sarc.nl>

* Fix bugzilla 24431 - dmd -vcg-ast crashes printing failed template in… (#16916)

---------

Co-authored-by: Richard (Rikki) Andrew Cattermole <richard@cattermole.co.nz>
Co-authored-by: Martin Kinkelin <kinke@users.noreply.github.com>
Co-authored-by: Dennis <dkorpel@users.noreply.github.com>
Co-authored-by: Martin Kinkelin <mkinkelin@symmetryinvestments.com>
Co-authored-by: Martin Kinkelin <noone@nowhere.com>
Co-authored-by: RazvanN7 <razvan.nitu1305@gmail.com>
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
Co-authored-by: Dennis Korpel <dkorpel@gmail.com>
2024-10-07 12:00:14 +03:00
Nick Treleaven
da45058997 Fix checking first member of union after zero size field 2024-10-05 08:56:44 +08:00
Nick Treleaven
5197836d45 Fix Bugzilla 24776 - Struct with anonymous union has wrong isZeroInit 2024-10-05 08:56:44 +08:00
Nick Treleaven
8eeadd7d97 Undo fix for anonymous union, breaks other code 2024-10-05 08:56:44 +08:00
Nick Treleaven
489e1b9eac Fix Bugzilla 23841 - isZeroInit does not take into account unions 2024-10-05 08:56:44 +08:00
Nick Treleaven
4d0f92b6db Bugzilla 24776 - Struct with anonymous union has wrong isZeroInit 2024-10-05 08:56:44 +08:00
Dennis
3f48f53e27
Fix bugzilla 24431 - dmd -vcg-ast crashes printing failed template in… (#16916) 2024-10-04 07:47:09 +08:00
Dennis
e0259d92e7
Fix bugzilla 24764 - ICE when -vcg-ast prints imported invariant (#16917)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
2024-10-03 13:47:19 +02:00
Dennis
f420f988ab
Fix bugzilla 24790 - -vcg-ast ICE on lowered assign exp (#16914)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
2024-10-03 13:46:41 +02:00
Tim Schendekehl
0e8e67097d
Fix bugzilla 23812 - ImportC: allow adding function attributes to imported C functions (#16820)
This adds a new pragma for ImportC, which allows to set default storage
classes. Only `nothrow`, `@nogc` and `pure` are supported for now.
They can be disabled later using `#pragma attribute(pop)`.

Unknown storage classes are ignored.
2024-09-14 10:58:00 -07:00
RazvanN7
c312124f59 Fix Bugzilla Issue 24762 - @nogc false positive error 2024-09-12 13:45:36 +02:00
RazvanN7
219b4f07e4 Fix Bugzilla Issue 24760 - ICE on variadic after default argument 2024-09-12 10:10:24 +02:00
Tim Schendekehl
6884b433d2
Fix bugzilla 24733 - ImportC: #pragma pack(pop) restores wrong alignment (#16821) 2024-08-31 21:31:56 +02:00
Nicholas Wilson
017684569b [test/compileable/vastartend.c] use main function
rather than passing `-main`
2024-08-28 11:06:26 +02:00
Nicholas Wilson
df377af9fe
[Deprecation -> Error] destructor field attributes (#16802) 2024-08-22 09:35:39 +03:00
Nick Treleaven
8974bb128d
Fix Bugzilla 24707 - error message has bad parameter attribute order (#16791)
* Fix Bugzilla 24707 - error message has bad attribute order

* Fix tests

* Fix & split error test into 2 lines
2024-08-19 14:29:23 +03:00
Tim Schendekehl
9ff8980a06
Fix bugzilla 24639 - ImportC: defines of negative constants not detected for enum conversion (#16789)
Negative expressions inside parens are already supported. This adds
support for defines with negative numbers without parens, but not more
complex expressions. Defines for negative numbers are often used as
error codes in C.
2024-08-17 22:14:05 +08:00