Change Log: 2.104.0
Download D nightlies
To be released
This changelog has been automatically generated from all commits in master since the last release.
- The full-text messages are assembled from the changelog/ directories of the respective repositories: dmd, druntime, phobos, tools, dlang.org, installer, and dub.
- See the DLang-Bot documentation for details on referencing Bugzilla. The DAutoTest PR preview doesn't include the Bugzilla changelog.
- The pending changelog can be generated locally by setting up dlang.org and running the pending_changelog target:
make -f posix.mak pending_changelog
Compiler changes
Library changes
List of all upcoming bug fixes and enhancements in D 2.104.0.
Compiler changes
- Add __check(assign-expression) to ImportC
C code normally relies on #include <assert.h> to add support for assert's. D has them builtin to the language, which is much more convenient and does not rely on a preprocessor. This extension adds
__check(assign-expression)
as an expression to ImportC. The compiler switch -checkaction=C gives it the same behavior as C's assert macro. If the compiler switch -release is thrown, the __check's are ignored. The __check expressions are handy for writing C programs that are free of reliance on #include.
__assert is not used due to conflicts with some C .h files.
- Alias this for classes is deprecated
Using alias this for classes has not been clearly specified and the lookup rules in such circumstances are not defined. As a consequence, various failures or crashes may appear when alias this is used in conjunction with classes. Starting with this release, alias this for classes is being deprecated. As an alternative, getter/setter methods may be used to replace the alias this. This can be generically handled by:
static foreach(member, __traits(allMembers, LeClass)) mixin("ref auto " ~ member() { return $field_name." ~ member ~ "; }");
- -preview=dip25 has been enabled by default
Deprecation warnings for DIP25 violations have been enabled since 2.092. Starting with this release, it will report errors, unless the -revert=dip25 switch is used. Using the switch (or its short version -dip25) is now deprecated.
ref int escapeRef(ref int x) {return x;} // Formerly: // Deprecation: returning `x` escapes a reference to parameter `x` // perhaps annotate the parameter with `return` // // Now it is an error, unless `-revert=dip25` is used
- export int a; now generates dllexport instead of dllimport
In order to make it dllimport, use:
export extern int a;
- Deprecate traits(isVirtualFunction) and traits(getVirtualFunctions)
Up until this release, D had both traits(isVirtualFunction) and traits(isVirtualMethod) (and their coressponding traits(get...) counterpart). The differenrcte between the two is that isVirtualFunction returns true for final methods that do not override anything. This is in contradiction with the D spec which states that final functions that do not override other functions cannot be virtual. isVirtualMethod correctly returns false in that case.
Starting with this release, both traits(isVirtualFunction) and traits(getVirtualFunctions) are deprecated. If the behavior of traits(isVirtualFunction) is desired, it can be achieved by traits(isVirtualMethod, f) || (traits(isFinalFunction, f) && !traits(isOverrideFunction, f)).
Library changes
- Unicode grapheme walking updated to conform to Unicode version 15
Up until now graphemeStride, byGrapheme and decodeGrapheme functions in std.uni have used obsolete rules from earlier Unicode standards.
This release brings grapheme breaking rules up to date with Unicode version 15. This means Phobos functions now recognise extended pictogram sequences and prepend characters.
- Better static assert messages for std.algorithm.iteration.joiner
Up until now filter used a template constraint to check if the passed Data could be used. If it were not, it was very tedious to figure out why.
As the template constraint is not used to overload the symbol template function, the constrains are move into static asserts with expressive error messages.
- Better static assert messages for std.algorithm.sorting.sort
Up until now sort used a template constraint to check if the passed Range could be used. If it were not, it was very tedious to figure out why.
As the template constraint is not used to overload the symbol template function, the constrains are move into static asserts with expressive error messages.
List of all bug fixes and enhancements in D 2.104.0:
DMD Compiler regression fixes
- Bugzilla 20090: Header generation wrongfully outputs constructor bodies
- Bugzilla 23764: Message printed twice: Usage of in on parameter
- Bugzilla 23816: Typing invalid mnemonic in asm{} block segfaults
- Bugzilla 23832: dmd regression 2.103.0 silent error cannot call decode at runtime
- Bugzilla 23874: -profile=gc segfaults / ICE regression
- Bugzilla 23882: ICE (segfault) on nasty alias this code
- Bugzilla 23905: Initialization of SumType with opaque enum causes ICE
- Bugzilla 23913: __traits(getMember) fails for some C symbols
DMD Compiler bug fixes
- Bugzilla 12118: Modify immutable data using throw
- Bugzilla 18493: [betterC] Can't use aggregated type with postblit
- Bugzilla 19454: Name collisions with unnamed function parameters
- Bugzilla 19706: Attribute inference in struct fails
- Bugzilla 20737: TLS variables unusable with -betterC for Windows MSVC targets
- Bugzilla 21667: scope parameter causes 'no size because of forward references'
- Bugzilla 22739: Segmentation fault in CppMangleVisitor.headOfType
- Bugzilla 22760: Segmentation fault in CppMangleVisitor.template_arg
- Bugzilla 22765: Assertion failure in CppMangleVisitor.template_args
- Bugzilla 22785: joiner does not support range over immutable
- Bugzilla 22857: Segfault for malformed static if in imported template
- Bugzilla 22960: importC: K&R-style functions assume variadic calling convention
- Bugzilla 23014: importC: static thread-locals do not work
- Bugzilla 23055: importC: using compound-literal array as pointer in CTFE gives 'dereference of invalid pointer'
- Bugzilla 23402: importc function definitions from includes can cause D name conflicts
- Bugzilla 23427: ImportC: some bitfield combinations lead to wrong size struct
- Bugzilla 23509: ImportC: need statement expressions extension for GLibC's assert()
- Bugzilla 23691: compilable/test22294.i:16:1: control Z interpreted as end of file
- Bugzilla 23715: ImportC: No rejection of _Thread_local variables declared at function scope without 'static' as per C11 6.2.4-5
- Bugzilla 23727: ImportC support imaginary real numbers
- Bugzilla 23784: ImportC: __ptr32, __ptr64
- Bugzilla 23787: ImportC: __unaligned
- Bugzilla 23789: ImportC: __declspec(align(n))
- Bugzilla 23795: Cannot cast _Complex!double to _Complex!float
- Bugzilla 23801: ImportC: enumeration constant does not fit in an int
- Bugzilla 23802: ImportC: __volatile__ is yet another alias for volatile
- Bugzilla 23808: #include
is not working with importc - Bugzilla 23822: Deprecated struct alias ignored completely
- Bugzilla 23826: Deprecated type member passed to template doesn't warn
- Bugzilla 23836: Two errors printed for typeof(super) in non-static member context
- Bugzilla 23837: importc fails to link on windows x86 but successes on x64
- Bugzilla 23838: DMD lexer / parser examples might not compile
- Bugzilla 23861: Compiler segmentation fault with ref and alias this
- Bugzilla 23863: typeof rejects AliasSeq!() as argument
- Bugzilla 23866: ImportC: Multiple __declspecs rejected
- Bugzilla 23867: ImportC: undefined identifier __builtin_isnan
- Bugzilla 23869: ImportC: undefined identifier isfinite
- Bugzilla 23873: [ICE] segfault on imported static if ; else auto x
- Bugzilla 23885: [CI] C++ interop tests with g++ fail
DMD Compiler enhancements
- Bugzilla 13577: More informative error message for refused immutable foreach loop
- Bugzilla 17374: Improve inferred attribute error message
- Bugzilla 20268: anonymous function parameter mismatch errors don't include parameters
- Bugzilla 22559: ImportC: support gnu case ranges
- Bugzilla 23401: ImportC: add -cpp=filename switch to select C preprocessor
- Bugzilla 23862: with statement should accept an expression with enum type
Phobos bug fixes
- Bugzilla 19642: std.range.slide!(No.withPartial) on lengthless forward range: get empty when expecting one window
- Bugzilla 22147: DList can't accept a struct with postblit disabled
- Bugzilla 22786: maxElement et al does not support range over immutable
- Bugzilla 23834: std.file : File links to c functions are invalid and need updating
- Bugzilla 23846: std.math can't compile under macos rosetta
Phobos enhancements
- Bugzilla 6106: Keep track of changes during replace function
- Bugzilla 14478: isInputRange should allow ranges of non-copyable elements
- Bugzilla 23769: Lambda isn't a unary predicate for lambda that doesn't compile
Druntime regression fixes
- Bugzilla 23859: [REG 2.103] Throwing while in a deep callstack causes memory corruption
Druntime bug fixes
- Bugzilla 14891: profilegc_setlogfilename w/o null-terminated string might fail during fopen
- Bugzilla 23949: core.stdc.assert_ for FreeBSD and DragonFlyBSD is incorrect
Druntime enhancements
- Bugzilla 11989: Phase out TickDuration
dlang.org bug fixes
- Bugzilla 14932: The language specification does not define what the shared attribute does
- Bugzilla 23698: ImportC: __stdcall is not documented as supported MSVC/DMC extensions
- Bugzilla 23699: ImportC: Unclear documentation that struct/union/enum introduce implicit typedefs
- Bugzilla 23872: Wrong example in Interfacing to C: Calling printf section
Contributors to this release (38)
A huge thanks goes to all the awesome people who made this release possible.
- Adam D. Ruppe
- Andrew Lalis
- Ate Eskola
- Atila Neves
- Caleb Xu
- Christian Koestlin
- Denis Feklushkin
- Dennis
- Dennis Korpel
- Dmytro Katyukha
- drpriver
- Ernesto Castellotti
- Grim Maple
- Hiroki Noda
- Iain Buclaw
- jamesragray
- Jan Jurzitza
- Jeremy
- Jordi Sayol
- Lance Bachmeier
- Lucian Danescu
- lucica28
- Marcelo Silva Nascimento Mancini
- Mathias Lang
- Mathis Beer
- Max Haughton
- Mike Parker
- Nick Treleaven
- Per Nordlöw
- Petar Kirov
- Rainer Schuetze
- Razvan Nitu
- Robert burner Schadek
- Steven Schveighoffer
- Temtaime
- Teodor Dutu
- Vladimir Panteleev
- Walter Bright