Commit graph

726 commits

Author SHA1 Message Date
Nick Treleaven
46ad3c183e [changelog] Improve static array .tupleof entry
Tweak description & link to more relevant subheading.
Remove example involving nativeToBigEndian (a bit obscure, not clear
what the return type is).
Add example showing tupleof assignment.
2022-04-06 12:09:27 +01:00
Paul Backus
af9b85a1f5 DIP 1038: make @mustuse lower case 2022-04-05 21:23:18 -04:00
Paul Backus
f6d5143a94 DIP 1038: add changelog entry 2022-04-05 21:23:18 -04:00
Steven Dwy
cdd0748eb4 Add changelog entry for static array .tupleof 2022-03-30 11:04:23 +02:00
MoonlightSentinel
15ecd8c351 Fix 22954 - dtoh: Ignore member functions with C linkage
Those functions receive D mangling and hence aren't easily callable via
the header file. Note that C++ does the same for members in an
`extern "C"` aggregate (=> mangle as C++ symbol).
`
2022-03-29 11:00:58 +00:00
MoonlightSentinel
3b20c1da54 Fix 22951 - Emit non-extern (C++) destructors as private members
Destructors not marked as `extern (C++)` aren't accessible from C++
due to the D name mangling. The header generator used to skip `extern(D)`
destructors, allowing C++ code that violated RAII guarantees.

Declaring the constructors as `private` members ensures that any
instance that would need to be destroyed on the C++ side causes a
compiler error (rather than a linker error due to missmatched mangling).

Renamed the helper function `checkVirtualFunction` because it now also
handles other types of functions.
2022-03-29 07:58:23 +00:00
Luís Ferreira
8f52682067 frontend: make unannotated asm blocks error instead of deprecation
This is a really old deprecation that already passed the deprecation period for
more than 5 years.

Signed-off-by: Luís Ferreira <contact@lsferreira.net>
2022-03-28 12:37:11 +00:00
João Lourenço
8afba50e59 chore(changelog): add a more in-depth preview of the version condition D_Invariant feature
Signed-off-by: João Lourenço <jlourenco5691@gmail.com>
2022-03-28 08:45:13 +08:00
MoonlightSentinel
a5eda669b1 Fix 22489 - dtoh: Handle custom mangling for functions (and globals)
Explicit mangling provided via `pragma(mangle, "..")` cannot be mapped
to C++. For `extern(C)` function it's possible to emulate the behavior
by replacing the identifier with the custom mangling. This doesn't work
for `extern(C++)` functions, so they are ignored.

The same rationale + solution applies to global variables with custom
mangling.
2022-03-27 12:19:58 +00:00
MoonlightSentinel
c9d6c52853 Fix 22934 - Emit context pointer as outer instead of this
Because the latter is obviosly not a valid identifier.
2022-03-27 13:10:12 +08:00
MoonlightSentinel
48db76398c
Merge remote-tracking branch 'upstream/stable' into merge_stable 2022-03-27 03:55:23 +02:00
Dennis
41a739fd02
Fix issue 22027, 22840 - inout doesn't imply return (#12689) 2022-03-22 12:44:15 +02:00
MoonlightSentinel
aa42a6bfdb Fix 22868 - Let __traits(parameters) see past opApply delegates
Ensure that `__traits(parameters)` consistently returns the parameters
of the enclosing function and instead of the parameters of the
`opApply` delegate (leaking an implementation detail).

Also added a bunch of tests - the parts hidden by `version (Fixed)`
fail due to another bug.
2022-03-12 16:43:27 +00:00
Martin Nowak
b335e410c8 Merge remote-tracking branch 'upstream/stable' into merge_stable
Conflicts:
	src/dmd/lexer.d
2022-03-08 16:05:19 +01:00
Martin Nowak
f5152bc721 purge changelog 2022-03-07 23:18:23 +01:00
Iain Buclaw
5f23d63c59 Deprecate 'scope' as a type constraint on struct and enum declarations 2022-03-06 12:03:06 +00:00
Geod24
3f146303bb Changelog: Tweak the release notes for scope class deprecation
A common misunderstanding is the difference between scope at the usage site
and scope on class declaration. So be extra verbose to let the user know
what is deprecated and what is not. Also remove the mention of structs,
as 'scope' on struct doesn't seem to have any effect, and many people
don't even know it is possible.
2022-03-05 18:51:53 +01:00
Iain Buclaw
ddbe7e28e5 Deprecate 'scope' as a type constraint on class declarations 2022-03-05 12:04:02 +00:00
Iain Buclaw
519ea6b645 End deprecation period for D1 style overload operators 2022-03-05 07:49:34 +08:00
Iain Buclaw
06360636c0 Merge remote-tracking branch 'upstream/stable' into merge_stable 2022-02-26 15:39:10 +01:00
Iain Buclaw
154f0f1a18 End deprecation period for using 'alias this' for partial assignment. 2022-02-18 15:31:27 +00:00
Nick Treleaven
a3865eb2b4 [stable] [changelog] Add item for noreturn main 2022-02-18 14:16:53 +00:00
Nick Treleaven
b051cc64a5 [changelog] Fix using sequence, not tuple 2022-02-18 12:31:00 +00:00
Nick Treleaven
380f9d83ae
[changelog] Fix using sequence, not tuple (#13670) 2022-02-17 15:07:33 +02:00
Iain Buclaw
d91171841c End deprecation period for the 'delete' keyword 2022-02-17 02:00:04 +00:00
Iain Buclaw
92db4554e8 End deprecation period for 'scope' as a type constraint on interface declarations 2022-02-16 22:01:42 +00:00
Iain Buclaw
61c05095d5 dmd.typesem: Remove usage of 'this' and 'super' as types 2022-02-16 15:06:15 +00:00
Walter Bright
153f706dc1
fix Issue 22541 - DIP1000: Resolve ambiguity of ref-return-scope parameters (#13357) 2022-01-24 13:55:38 +02:00
Martin Kinkelin
2acf557096
Remove -unittest special cases wrt. template emission (#13224)
* WIP: Remove -unittest special cases wrt. template emission

* WIP

* WIP2

* WIP3

* WIP4

* WIP5

* Print full compiler command-line in case building the unit_test_runner executable fails

* WIP6

* WIP7

* Ignore unittest blocks in non-root modules

* Temporary: Test with enforced -allinst

* Revert "Temporary: Test with enforced -allinst"

This reverts commit 6f1a5302d7cb981654e55722860fae0ddadbbc07.

* Add comment as to why unittests in non-root modules are ignored

And ignore them for doDocComments/doHdrGeneration too, for
consistency.

* Add changelog entry
2022-01-24 12:00:34 +02:00
Max Haughton
ad2d9a2616
Fixed macro paren 2022-01-21 21:36:03 +00:00
Nicholas Wilson
3ff790c1bc
Merge pull request #13162 from MoonlightSentinel/noreturn/throw-expression-full
Implement throw expressions (DIP 1034)
2022-01-21 22:54:17 +08:00
Max Haughton
f02995ebac
Fix Issue 22291 - Implement __traits(parameters) (#13071)
* Fix Issue 22291 - Implement __traits(arguments)

* Changelog and add functions from changelog to tests

* Rename the delegate as it collides with something somewhere else apparently

* Traits args: Style, Tests, Changelog, add a fail_compilation

* Update frontend header

* Turn argument into parameter

* Frontend change also

* Rebase and indentation

* Review comments, changelog grammar, newline

* Fix nits

Co-authored-by: RazvanN7 <razvan.nitu1305@gmail.com>
2022-01-21 16:37:22 +02:00
Nicholas Wilson
7d1f4440f8
Produce MS Coff by default when targetting windows (#13110)
* Produce MS Coff by default when targetting windows

This rebases #12825 but doesn't attempt to rename phobos libraries and doesn't change the build infra where possible(and doesn't have a large diff in `link.d`). See if this fixes the CI issues.

* remove OMF piplines

* Update glue.d

* Update target.d

* Update target.d

* Update frontend.h
2022-01-21 10:09:52 +02:00
Walter Bright
59b4e39260
ImportC: add support for importing modules with __import (#13539) 2022-01-17 13:44:23 -08:00
Hiroki Noda
d56dc86c51 Fix Issue 22672 - Allow casting from TypeTuple to TypeTuple
Currently DMD does not allow casting to TypeTuple even if they
are the same type is.
This is a bit odd, so only allow it in certain case.

Co-authored-by: Boris Carvajal <boris2.9@gmail.com>
Co-authored-by: Razvan Nitu <razvan.nitu1305@gmail.com>
2022-01-14 18:31:18 +00:00
RazvanN7
c50cbf14a7 Rebase + add more information in the changelog entry 2022-01-10 14:48:59 +02:00
Walter Bright
7154c6ad77 add changelog for -vasm 2022-01-10 14:42:53 +02:00
dkorpel
2fd591de1c Turn switch case fallthrough into an error 2022-01-09 12:28:27 +00:00
MoonlightSentinel
b425f05e8c
Changelog entry for throw expressions 2022-01-07 18:17:48 +01:00
Dennis
bb8f969d3e
Fixup intpromote by default (#13363) 2021-11-29 11:25:44 +02:00
12345swordy
d5e0407249
Set the preview switch fix16997 to true now. (#13348)
* Set the preview switch fix16997 to true now.

* Add preview switch.

* Fix test suit

* Fix the reverthelp.d test

* Auto gen the frontend

* Fix changelog/fix16997.dd

* Corrected frontend.h

* Update fix16997.dd

Modify changelog

* Fix trimming of spaces for changelog/fix16997.dd

* Update fix16997.dd

Fix Title description tile for changelog and move some text around

* Remove empty line

* Update fix16997.dd

add markdown

* Update fix16997.dd

* single quotes

Co-authored-by: MoonlightSentinel <moonlightsentinel@disroot.org>
2021-11-26 09:17:28 +02:00
MoonlightSentinel
37ef8581e3 Implement the LDC specific __traits(initSymbol)
`__traits(initSymbol, S)` was introduced in ldc-developers/ldc#3774 and
provides access to the initializer symbol of `S` in a way that does not
rely on `TypeInfo` or other hacks.

This commit contains some small adjustments to the initial patch which
improve the user experience:

- generated `VarExp` points to the `TraitsExp` instead of the symbol LoC
- CTFE issues a specific error message
- rejects interfaces because they don't have an initializer symbol and
  hence cause linker failures
- more extensive tests

Co-authored-by: Nicholas Wilson <iamthewilsonator@hotmail.com>
2021-11-17 03:10:36 +00:00
Martin Nowak
08554f7dfa purge changelog 2021-10-10 14:43:07 +02:00
Dennis
1f0793e0d0
Pull 2.098 changelog fixes from master (#13113) 2021-09-30 17:18:35 +03:00
Iain Buclaw
9fb279b9ce dtoh: Do not emit aliases to declarations as typedef 2021-08-05 16:52:59 +00:00
dkorpel
05d2188ad1 Fix issue 15889 - Array bounds check should report index and length 2021-08-03 09:29:10 +09:00
Iain Buclaw
571d19269c End deprecation period for incorrect initialization of union when first member isn't marked (Issues 19919 and 19917) 2021-07-30 12:25:38 +00:00
Iain Buclaw
20c5bad402 End deprecation period for allocators
The error has now been moved to the grammar. However there are new
deprecations for when the only remaining allowed use of allocators is
not explicitly `@disable new();`
2021-07-24 13:30:21 +00:00
Iain Buclaw
860166df87 End deprecation period for modifying immutable variable from static this 2021-07-23 11:35:51 +09:00
Carsten Schlote
3556605e91
Add .i extension for preprocessed C files to known file extensions (#12879)
* Add .i extension for preprocessed C files to known set of file extensions

Added .i as extension for preprocessed C files, which can be fed directly
to DMD. The file is then processed as C source file.

Supporting .i as file exzension allows to preprocess C code with GCC -E and
store the output to some file for further processing by DMD.

* Update existing Changelog on 'importc' feature.

Add some example on how to use the '.i' suffix instead of the '.c' suffix
for C files using C includes. Result of C preprocessor can be saved as
'.i' file and used as input to DMD.

* Add some first simple test for importc with .i files passed on cmdline

* Hide preprocessed C files

* Changed importc test to use .i.in file to fake preprocessor

TODO: Find some preprocessor, which works on Windows and Max targets.

Co-authored-by: Carsten Schlote <carsten.schlote@leica-camera.com>
2021-07-17 08:10:00 +08:00