Change Log: 2.099.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
- Add Alias Assignment
- Accessing C Declarations From D Via ImportC Compiler
- Using the syntax (args) => {} now triggers a deprecation message
- Improvements for the C++ header generation
- -preview=dtorfields is now enabled by default
- Add .min, .max, etc. properties for vector types.
- Using a mutable variable as a switch case now triggers an error
- Out of bounds array access now gives a better error message
- Class allocators have been removed from the language
- Initialization of immutable global data from static this now triggers an error
- Add -target=<triple> for operating system, c, and c++ runtime cross compilation
- Default initialization of union field that isn't the first member now triggers an error
Runtime changes
Library changes
Dub changes
List of all upcoming bug fixes and enhancements in D 2.099.0.
Compiler changes
- Add Alias Assignment
This adds the ability for an alias declaration inside a template to be assigned a new value. For example, the recursive template:
template staticMap(alias F, T...) { static if (T.length == 0) alias staticMap = AliasSym!(); else alias staticMap = AliasSym!(F!(T[0]), staticMap!(T[0 .. T.length])); }
can now be reworked into an iterative template:
template staticMap(alias F, T...) { alias A = AliasSeq!(); static foreach (t; T) A = AliasSeq!(A, F!t); // alias assignment here alias staticMap = A; }
Using the iterative approach will eliminate the combinatorial explosion of recursive template instantiations, eliminating the associated high memory and runtime costs, as well as eliminating the issues with limits on the nesting depth of templates. It will eliminate the obtuse error messages generated when deep in recursion.
The grammar:
AliasAssign: Identifier = Type;
is added to the expansion of DeclDef. The Identifier must resolve to a lexically preceding AliasDeclaration:
alias Identifier = Type;
where the Identifier's match, and both are members of the same TemplateDeclaration. Upon semantic processing, when the AliasAssign is encountered the Type in the AliasAssign replaces the Type from the corresponding AliasDeclaration or any previous matching AliasAssign.
The AliasAssign grammar was previously rejected by the parser, so adding it should not break existing code.
- Accessing C Declarations From D Via ImportC Compiler
One of D's best features is easy integration with C code. There's almost a one-to-one mapping between C and a subset of D code (known as DasBetterC). D and C code can call each other directly.
But D cannot read C code directly. In particular, the interface to most C code comes in the form of a .h (or "header") file. To access the declarations in the .h file and make them available to D code, the C declarations in the .h file must somehow be translated into D. Although hand translating the .h files to D is not difficult, it is tedious, annoying, and definitely a barrier to using D with existing C code.
Why can't the D compiler simply read the .h file and extract its declarations? Why doesn't it "just work"? D has had great success with integrating documentation generation into the language, as well as unit testing. Despite the existence of many documentation generators and testing frameworks, the simplicity of it being built in and "just working" is transformative.
The C Preprocessor
Is its own language that is completely distinct from the C language itself. It has its own grammar, its own tokens, and its own rules. The C compiler is not even aware of the existence of the preprocessor. (The two can be integrated, but that doesn't change the fact that the two semantically know nothing about each other.) The preprocessor is different enough from D that there's no hope of translating preprocessor directives to D in anything but the most superficial manner, any more than the preprocessor directives can be replaced with C.
Previous Solutions
htod by Walter Bright
htod converts a C .h file to a D source file, suitable for importing into D code. htod is built from the front end of the Digital Mars C and C++ compiler. It works just like a C or C++ compiler except that its output is source code for a D module rather than object code.
DStep by Jacob Carlborg
From the Article: "DStep is a tool for automatically generating D bindings for C and Objective-C libraries. This is implemented by processing C or Objective-C header files and outputting D modules. DStep uses the Clang compiler as a library (libclang) to process the header files."
dpp by Átila Neves
From the Article: "dpp is a compiler wrapper that will parse a D source file with the .dpp extension and expand in place any #include directives it encounters, translating all of the C or C++ symbols to D, and then pass the result to a D compiler (DMD by default)."
Like DStep, dpp relies on libclang.
Introducing ImportC, an ISO C11 Compiler
Here is the next step:
- Forget about the C preprocessor.
- Overlook C++.
- Put a real ISO C11 compiler in the D front end.
- Call it ImportC to distinguish this unique capability.
In detail:
- Compile C code directly, but only C code that has already been run through
gcc -E -P stdio.h >stdio.c
and in the D source file:
import stdio; // reads stdio.c and compiles it
With gcc doing all the preprocessor work, it becomes 100% behavior compatible.
- A C compiler front end, stripped of its integrated preprocessor, is a simple
- The D part of dmd will have no idea it originated as C code. It would be
Using ImportC As A C Compiler
Instead of importing C code, dmd can be used to compile C code like a standalone C compiler.
Create the file hello.c:
int printf(const char*, ...); int main() { printf("hello world\n"); }
Compile and run it:
dmd hello.c ./hello hello world!
For C code using C includes you can preprocess the C source with a C preprocessor. Create the file testcode.c:
#include <stdint.h> uint32_t someCodeInC(uint32_t a, uint32_t b) { return a + b; }
Preprocess the C code with the C preprocessor:
gcc -E -P testcode.c >testcode.i
Create D file d_main.d:
import std.stdio; import testcode; void main() { writeln("Result of someCodeInC(3,4) = ", someCodeInC(3, 4) ); }
Compile and run it:
dmd d_main.d testcode.i ./d_main Result of someCodeInC(3,4) = 7
The '.i' file extension can be used instead of '.c'. This makes it clear, that preprocessed imtermediate C code is in use. The '.i' files can be created by some generator script or a Makefile.
Implementation Details
User Experience
- Error messages are spare and utilitarian.
- Recovering after encountering an error is not well developed.
- Pretty-printing code is done in D syntax, not C. Also,
- No warnings are emitted. ImportC doesn't care about coding style,
- If the ImportC code corrupts memory, overflows buffers, etc.,
- Symbolic debugging support is there.
Variance From ISO C11
- Doesn't have a C Preprocessor.
- Tag symbols are part of the global symbol table, not the special tag
- Multiple chars in char literal are not supported.
- _Atomic as type qualifier is ignored.
- _Atomic as type specifier is ignored.
- _Alignof is ignored.
- _Generic is not implemented.
- const is transitive, as in D. A pointer to a const pointer to a mutable
- { initializer-list } is not implemented.
- ( type-name ) { initializer-list } is not implemented.
- Complex numbers are not implemented.
- Forward referencing works in ImportC. All global symbols are visible
- Semantics applied after C parsing are D semantics, not C semantics,
Implementation Defined Behavior
The C11 Standard allows for many instances of implementation defined behavior.
- volatile, restrict, register, _Noreturn are accepted and ignored
- char is unsigned
- inline is ignored, as the D compiler inlines what it feels like inlining.
- long double matches what the host C compiler does, which is not necessarily
Extensions
Using a D compiler for semantic processing offers many temptations to add in better D semantics. Inventing yet another new dialect of C is not the point of ImportC. However, some things are useful:
- Compile Time Function Execution
This works. It comes in handy for writing test cases for ImportC using _Static_assert. It also means that the D compiler can execute the ImportC functions in imports just like it can for D.
Unimplemented Extensions
- Much of C code makes use of extensions provided by the host C compiler.
- Alternative keywords are not implemented. You can define the alternate keywords as macros to remove or replace them with standard keywords.
#define __attribute __attribute__ #define __asm asm #define __asm__ asm #define __const const #define __const__ const #define __inline inline #define __inline__ inline #define __extension__ #include <stdlib.h>
Future Directions
C Preprocessor
Some means of incorporating this may be practical. For now, use cpp, warp or spp.
Translation of C macros to D needs to be done, as htod, DStep and dpp all do this.
ImportC++ ?
No. Use dpp.
ImportObjective-C ?
No. Use DStep.
Documentation
More info on ImportC will be written on its page in the specification.
- Using the syntax (args) => {} now triggers a deprecation message
Newcomers from languages with built-in delegates (such as JavaScript and C#) would often use (args) => { /* body */ } for delegate/function literals.
However, in D, this syntax results in a delegate that returns a delegate, without any other side effects. This may trigger hard-to-debug bugs, therefore it is now deprecated.
If a delegate returning a delegate is indeed the intended usage, use either (args) { return () => /* body */; } or (args) => () { /* body */ }.
- Improvements for the C++ header generation
The following features/bugfixes/improvements were implemented for the experimental C++ header generator:
- Declarations from template mixins are emitted into the instantation context
- (Superclass) methods aliases are emitted as using ... instead of typedef ...
- extern(D) symbols are no longer emitted by accident in certain situations
- extern(D) structs and classes are emitted if referenced by an exported symbol
- Symbols referenced from template declarations are emitted before their first use
- Forward declarations consistently include template<...>
- extern(C++, class), extern(C++, struct) affects forward declarations
- Types used in reference parameters are forward declared if possible
- Renamed or local imports are emitted as using ... when possible
- Complex types are emitted as _Complex.
- Declarations are emitted before the first member access
- Global variables with invalid names in C++ are omitted
- Initializers of union variables/parameters omit non-active members
- Typecasts are emitted as C style, not D's cast(...) ...
- Structs are always tagged as final because D disallows struct inheritance
- No longer asserts for declarations using noreturn
- Symbol names always include template parameters and enclosing declarations when required
- Properly emits (static / enum) members of templated aggregates
- Properly emits static arrays in template declarations
- No longer omits the parent aggregate when referencing __gshared variables
- No longer uses D syntax for expressions nested in unary / binary expressions
- Does not emit public:, ... inside of anonymous structs/unions
- Does not emit typedef for aliases to declaration symbols
Note: The header generator is still considerer experimental, so please submit any bugs encountered to the bug tracker.
- -preview=dtorfields is now enabled by default
This preview ensures that partially constructed objects are properly destroyed when an exception is thrown inside of an constructor. It was introduced in 2.075 and is now enabled by default.
Note that code may fail to compile if a constructor with strict attributes may call a less qualified destructor:
struct Array { int[] _payload; ~this() { import core.stdc.stdlib : free; free(_payload.ptr); } } class Scanner { Array arr; this() @safe {} // Might call arr.~this() }
Such code should either make the constructor nothrow s.t. the destructor will never be called, or adjust the field destructors.
The compiler will only issue a deprectation for attribute violations caused by the inserted destructor call unless the -preview=dtorfields flag is explicitly specified.
- Add .min, .max, etc. properties for vector types.
For integral vector types, add the .min and .max properties.
For floating point vector types, add the .min, .max, .min_normal, .nan, .infinity, and .epsilon properties.
The value of those properties is the value corresponsing to the vector element type broadcast to the vector type. I.e.:
import core.simd; static assert(float4.max == cast(float4)float.max);
- Using a mutable variable as a switch case now triggers an error
Variables that are const or immutable can be used as switch cases even if they are initialized at run-time, but using variables that are mutable has been deprecated since dmd 2.073.2. This deprecation has now been turned into an error:
void foo(int s, int x, const int y, immutable int z) { switch (s) { case x: // error case y: // allowed case z: // allowed default: } }
It is advised to only use compile-time known values in case statements, because the presence of any run-time variable (even a const or immutable one) results in the entire switch being lowered to a series of if-else statements before code generation, instead of an efficient jump table. Prefer regular if-statements for comparing pairs of run-time known variables.
- Out of bounds array access now gives a better error message
Errors resulting from bad indexing will now contain the length of the array, as well as the offending index for arr[bad], or offending indices arr[bad1 .. bad2] for bad slices.
For example:
void main() { int[] a = [1, 2, 3]; int b = a[7]; }
Previously this would yield the following error when compiled and run:
dmd -run main.d [email protected](4): Range violation –––––––––– ??:? _d_arrayboundsp [0x555765c167f9] ??:? _Dmain [0x555765c16752]
It now yields:
dmd -run main.d [email protected](4): index [7] exceeds array of length 3 –––––––––– ??:? _d_arraybounds_indexp [0x5647250b980d] ??:? _Dmain [0x5647250b9751]
Similarly, in case of out of bounds slice operations:
void main() { int[] a = [1, 2, 3]; int[] b = a[2 .. 4]; }
dmd -run main.d [email protected](4): slice [2 .. 4] extends past array of length 3 –––––––––– ??:? _d_arraybounds_slicep [0x5647250b980d] ??:? _Dmain [0x5647250b9751]
The error messages for an out of bounds slice copy (arr[a..b] = arr[c..d]) or indexing a non-existent key in an Associative Array (table["bad"]) have not been updated.
- Class allocators have been removed from the language
Class allocators have been deprecated since v2.080.0.
class C { new(size_t size) { return malloc(size); } }
Starting with this release all class allocators not annotated with @disable will result in a compilation error. As the grammar will also be changing, there are new deprecation messages for the old-style allocator syntax, which accepted a non-empty parameter list and function body.
class C { @disable new(size_t size) // Deprecation: non-empty parameter list { return malloc(size); // Deprecation: function definition } }
Example of corrective action:
class C { @disable new(); }
See the deprecated features page for more information.
- Initialization of immutable global data from static this now triggers an error
The following code has been deprecated since 2.087.0.
module foo; immutable int bar; static this() { bar = 42; }
This is problematic because module constructors (static this) run each time a thread is spawned, and immutable data is implicitly shared, which led to immutable value being overriden every time a new thread was spawned.
The corrective action for any code that still does this is to use `shared static this over static this`, as the former is only run once per process.
- Add -target=<triple> for operating system, c, and c++ runtime cross compilation
The command line switch -target=<triple> can be used to specify the target the compiler should produce code for. The format for <triple> is <arch>-[<vendor>-]<os>[-<cenv>[-<cppenv]]. Specific values of the specifiers are shown in the tables below.
<arch>
<arch> is an Architecture bitness, optionally followed by instruction set (which duplicates the functionality of the -mcpu flag)<arch> Architecture bitness x86_64 64 bit x64 64 bit x86 32 bit x32 64bit with 32 bit pointers subarch features equivalent -mcpu flag +sse2 baseline +avx avx +avx2 avx2 The architecture and subarch features are concatenated, so x86_64+avx2 is 64bit with avx2 instructions.
<vendor>
<vendor> is always ignored, but supported for easier interoperability with other compilers that report and consume target triples.<os>
<os> is the operating system specifier. It may be optionally followed by a version number as in darwin20.3.0 or freebsd12. For Freebsd, this sets the corresponding predefined version identifier, e.g. freebsd12 sets version(FreeBSD12). For other operating systems this is for easier interoperability with other compilers.
<os> Operating system freestanding No operating system darwin MacOS dragonfly DragonflyBSD freebsd FreeBSD openbsd OpenBSD linux Linux solaris Solaris windows Windows <cenv>
<cenv> is the C runtime environment. This specifier is optional. For MacOS the C runtime environment is always assumed to be the system default.
| glibc | GCC C runtime | linux | | newlib | Newlib Libc | | | uclibc | uclibc | |<cenv> C runtime environment Default for OS musl musl-libc msvc MSVC runtime Windows bionic Andriod libc digital_mars Digital Mars C runtime for Windows <cppenv>
<cppenv> is the C++ runtime environment. This specifier is optional. If this specifier is present the <cenv> specifier must also be present.
<cppenv> C++ runtime environment Default for OS clang LLVM C++ runtime MacOS, FreeBSD, OpenBSD, DragonflyBSD gcc GCC C++ runtime linux msvc MSVC runtime Windows digital_mars Digital Mars C++ runtime for Windows sun Sun C++ runtime Solaris - Default initialization of union field that isn't the first member now triggers an error
The following code has been deprecated since 2.088.0
union U { int a; long b = 4; }
This is problematic because unions are default initialized to whatever the initializer for the first field is, any other initializers present are ignored.
The corrective action is to declare the union field with the default initialization as the first field.
Runtime changes
- TypeInfo names for aggregates are fully qualified and hence unique now
Previously, template arguments weren't fully qualified; they now are, implying longer names in that case.
TypeInfo_Struct instances now store the (potentially significantly shorter) mangled name only and demangle it lazily on the first name or toString() call (with a per-thread cache). So if you only need a unique string per struct TypeInfo, prefer mangledName over computed name (non-@nogc and non-pure).
Related breaking change: TypeInfo.toString() isn't pure anymore to account for the TypeInfo_Struct demangled name cache. TypeInfo_Class.toString() and others are still pure.
- A concurrent GC for Posix systems
For Posix systems that support the fork() function (or the clone() on linux systems), the conservative/precise GC can be made concurrent by enabling the 'fork' GC options in the usual ways, e.g. by adding --DRT-gcopt=fork:1 to the command line or by embedding
extern(C) __gshared string[] rt_options = [ "gcopt=fork:1" ];
into your linked binary (see ../spec/garbage.html#gc_config).
The application continues execution and new memory is allocated from the system while the forked process is marking heap objects. Parallel marking is disabled for the forked process so it only uses a single thread for minimal impact on the concurrent execution of the application.
This reduces "stop the world" time at the cost of needing more memory and page-protection overhead when writing to memory currently being scanned.
- Improve POSIX imports
The lwpid_t symbol was added to core/sys/linux/sys/procfs.d. The O_CLOEXEC symbol was added to core/sys/posix/fcntl.d.
Library changes
- New function isValidCharacter in std.utf
A new function isValidCharacter has been added to std.utf. It can be used to check if a single character forms a valid code point. For example the char 0x80 is not a valid code point, because it can only be used in trailing characters of UTF8 sequences, whereas the wchar ä is a valid character:
assert(!isValidCharacter(cast(char) 0x80)); assert(isValidCharacter('ä'));
Dub changes
- Builds dynamicLibrary targets as dynamic libraries instead of static libraries.
Dub will no longer build dynamicLibrary targetType's as staticLibrary.
Except for x86_omf. This has been disabled due to numerous issues that will lead this to not doing what is expected of it.
No compiler or linker flags have been added at this time, you will need to specify the relevant flag to get the compiler to link dynamically against Phobos.
- The $DUB_BUILD_PATH variable was added
The $DUB_BUILD_PATH variable is now defined inside the postBuildCommands section. It contains the absolute path in which the package was built, and can be used to copy by-products of the build process to their intended locations.
For example, if an executable exports symbols, you will want to make the resulting import library and symbols export file available somewhere. That can be done with a dub.json section like this:
"postBuildCommands-windows": [ "copy /y $DUB_BUILD_PATH\\$DUB_TARGET_NAME.lib $PACKAGE_DIR\\lib" "copy /y $DUB_BUILD_PATH\\$DUB_TARGET_NAME.exp $PACKAGE_DIR\\lib" ],
- Command environment variable substitution changed
Now users can use the documented predefined variables inside custom command directives without the need for a wrapper shell script.
Before this would have failed:
"preBuildCommands": ["$DC -run foo.d"]
unless DC was defined as environment variable outside DUB.
It was before possible to run a script that used the $DC environment variable or on POSIX escape the $ with $$DC to make the shell substitute the variable. These workarounds are no longer needed now.
API change: none of the different command directives are no longer substituted with the process environment variables. You now access the raw commands as provided by the user in the recipe. dub describe has been adjusted and now also processes the predefined environment variables as well as the process environment variables.
List of all bug fixes and enhancements in D 2.099.0:
DMD Compiler regression fixes
- Bugzilla 17635: [REG 2.066.0] cannot convert unique immutable(int)** to immutable
- Bugzilla 20133: [REG2.084.0] Bogus slice assignment in recursive CTFE call
- Bugzilla 20236: spurious deprecation warnings on function calls within with(X) blocks while X has a deprecated alias this target
- Bugzilla 20860: OpDispatch does not work for structs with constructor and destructor
- Bugzilla 20998: error in static struct initialization causes wrong position for subsequent members, producing extra errors
- Bugzilla 21039: alias this returns 'null' for ref types when put into array initializer
- Bugzilla 21073: Rebindable does not work when class has alias this to inout property
- Bugzilla 21367: Nameless union propagates copy constructors and destructors over all members
- Bugzilla 21380: A case of compiler crash when using auto ref
- Bugzilla 21414: Spurious "non-constant expression" error with immutable constructors
- Bugzilla 21438: Compiler segfault on static array in a struct at CTFE
- Bugzilla 21538: Overriding with more attributes on delegate parameter is allowed
- Bugzilla 21674: [REG v2.086] alias this triggers wrong deprecation message on function call
- Bugzilla 21719: [REG 2.072] "auto" methods of classes do not infer attributes correctly.
- Bugzilla 22004: [REG2.097] Error: mismatched function return type inference of void and noreturn
- Bugzilla 22130: [REG2.080.1][DIP1000] pure factory functions stopped working
- Bugzilla 22151: Compiler crash when attempting to assign to function
- Bugzilla 22163: [REG 2.094.0] wrong code with static float array and delegate accessing it
- Bugzilla 22226: [REG 2.095.1] __ctfe + function call in conditional expression used to initialize struct member in constructor causes ICE
- Bugzilla 22254: Template instantiated twice results in different immutable qualifier
- Bugzilla 22300: [REG 2.098-rc.2] -checkaction=context of a shared type with an opCast fails to compile
- Bugzilla 22385: CTFE fails to iterate over associative array previously indexed with implicit conversion to enum base type
- Bugzilla 22410: [REG2.094] function with tuple parameter with default argument fails if there's a qualifier
- Bugzilla 22420: [REG2.098] Apparent CTFE regression wrt. alias this
- Bugzilla 22472: Invalid error message for void return from non-void functions
- Bugzilla 22512: importC: incomplete array type must have initializer
- Bugzilla 22514: Invalid duplicate case error when the switched value has errors
- Bugzilla 22516: Segfault for function literal in struct initializer with previous errors
- Bugzilla 22529: wrong deprecation about empty statement
- Bugzilla 22558: [REG 2.098] Error: function 'core.stdc.stdio.vfprintf' 'pragma(printf)' functions must be 'extern(C) int vfprintf([parameters...], const(char)*, va_list)'
- Bugzilla 22570: more arguments than fields allowed in struct constructor
- Bugzilla 22584: importC: Error: undefined reference to 'parameter' when no parameter names in forward declaration
- Bugzilla 22585: importC: Error: variable 'var' extern symbols cannot have initializers
- Bugzilla 22592: importC: Segmentation fault indexing global array at run-time
- Bugzilla 22593: ICE on overloaded constructors
- Bugzilla 22659: [REG master] Error: declaration '(S[2] arr = __error__;)' is not yet implemented in CTFE
- Bugzilla 22676: fullyQualifiedName fails to compile with 2.098.1 relese -- there is some issue with call to __traits(isScalar ..
- Bugzilla 22705: importC: forward reference to struct typedef gives struct already exists
- Bugzilla 22714: ICE: Assertion failure in ClassDeclaration::isBaseOf
- Bugzilla 22730: master: "dmd -i" doesn't include unit tests from imported modules
- Bugzilla 22738: std.file.tempDir adds an addition / even when it already has one
- Bugzilla 22761: [REG 2.099] importC: Error: redeclaration with different type
- Bugzilla 22780: [REG 2.090] variable reference to scope class must be scope
- Bugzilla 22804: [REG 2.099] compiling multiple files without linking produces broken object files
- Bugzilla 22816: [REG 2.099] Parser reads files with other extensions
- Bugzilla 22817: [REG 2.099] Missing file gives misleading error message
- Bugzilla 22826: [REG 2.098] #line accepts importC linemarker flags
DMD Compiler bug fixes
- Bugzilla 2: Hook up new dmd command line arguments
- Bugzilla 3: Finish or remove MatchExp::toElem
- Bugzilla 3818: Generic error message for wrong foreach
- Bugzilla 8346: Literals 00 - 07 results in odd errors when used with UFCS
- Bugzilla 10584: Unhelpful error default constructing nested class
- Bugzilla 15711: Incorrect type inferring of [char]/string when passed via recursive template, extracting it from a structure field
- Bugzilla 15804: missing UDAs on nested struct template
- Bugzilla 16579: ReturnStatement[CallExp(DotVarExp)]: Corrupted runtime on missed manifest constant propagation
- Bugzilla 17870: Can't alias a mix of parent and child class members
- Bugzilla 17977: [DIP1000] destructor allows escaping reference to a temporary struct instance
- Bugzilla 18054: Wrong cast of float constant to bool
- Bugzilla 18960: Function parameter requires name with default value
- Bugzilla 19320: -cov and -O yield variable used before set
- Bugzilla 19482: attributes incorrectly applied to static foreach local variables
- Bugzilla 19660: 'export' keyword on OSX/Linux globals causing segfaults
- Bugzilla 19873: function should be by default @system even with -preview=dip1000
- Bugzilla 20023: Separate compilation breaks dip1000 / dip1008 @safety
- Bugzilla 20691: Converting scope static array to scope dynamic array should be error
- Bugzilla 20777: User defined type as enum base type fails to compile.
- Bugzilla 20904: dip1000 implicit conversion delegates error
- Bugzilla 21093: [ICE] AssertError@dmd/optimize.d(691): Assertion failure
- Bugzilla 21431: Incorrect maximum and actual number of cases in a switch case range is reported
- Bugzilla 21794: Internal compiler assertion
- Bugzilla 21844: makedeps option adds spurious/incorrect dependency
- Bugzilla 21930: ICE (illegal instruction) with bad code
- Bugzilla 21950: cod1: Assertion failure for noreturn parameter
- Bugzilla 21952: ice for global / tls variable of type noreturn
- Bugzilla 21957: ice when dmd computes the alignment of an union containing a noreturn
- Bugzilla 21969: importC: Error: bit fields are not supported
- Bugzilla 22104: importC: Parser accepts arrays with incomplete element types
- Bugzilla 22124: Corrupted closure when compiling with -preview=dip1000
- Bugzilla 22127: compiler assertion failure parser on UDA and function literal
- Bugzilla 22137: -preview=dip1000 enables visibility checks for tupleof
- Bugzilla 22139: Compiler special cases object.dup when compiling with -preview=dip1000
- Bugzilla 22233: importC: (identifier)() incorrectly parsed as a cast-expression
- Bugzilla 22236: sizeof an empty C struct should be 0, not 1
- Bugzilla 22245: importC: Error: found . when expecting )
- Bugzilla 22267: ImportC: typedef-ed variable initialization with RHS in parenthesis doesn't parse
- Bugzilla 22277: removing strongly pure function calls is an incorrect optimization
- Bugzilla 22283: -preview=in -inline leads to strange error inside object.d
- Bugzilla 22285: markdown tables are not parsed correctly
- Bugzilla 22287: ambiguous virtual function for extern(C++) under Windows
- Bugzilla 22298: [DIP1000] Nested function's scope parameters can be assigned to variables in enclosing function
- Bugzilla 22305: ImportC: #pragma STDC FENV_ACCESS is not supported
- Bugzilla 22311: dmd slice length is wrong on DWARF
- Bugzilla 22315: ImportC: #pragma pack is not implemented
- Bugzilla 22323: Link error for virtual destructor of C++ class in DLL
- Bugzilla 22339: importC: error message with character literal reports as integer instead of character literal.
- Bugzilla 22342: importC: Error: function 'func()' is not callable using argument types '(int)'
- Bugzilla 22344: ImportC: overloading of functions is not allowed
- Bugzilla 22356: Can't mixin the return type of a function
- Bugzilla 22361: Failed import gives misleading error message
- Bugzilla 22362: ImportC: error parsing compound literal with more than one value at function scope.
- Bugzilla 22365: Compiler crash: tcs.body_ null in StatementSemanticVisitor.visit(TryCatchStatement) in semantic3 pass (dmd/statementsem.d:3956)
- Bugzilla 22366: [dip1000] scope variable can be assigned to associative array
- Bugzilla 22372: Loop index incorrectly optimised out for -release -O
- Bugzilla 22375: importC: Error: C non-array initializer not supported yet
- Bugzilla 22376: importC: Error: cannot use non-constant CTFE pointer in an initializer
- Bugzilla 22387: Noreturn init loses type qualifiers
- Bugzilla 22388: Wrong overload selected for @safe delegate
- Bugzilla 22389: noreturn functions are allowed to return normally
- Bugzilla 22398: importC: Error: unknown, when compiling source with non-constant initializer.
- Bugzilla 22399: importC: Error: static variable cannot be read at compile time
- Bugzilla 22400: importC: Error: unknown, when compiling source with typedef'd initializer
- Bugzilla 22401: importC: Error: cannot implicitly convert expression of type 'const(int[1])' to 'const(int*)'
- Bugzilla 22402: importC: Error: can't subtract '__tag2[1]' from pointer
- Bugzilla 22403: importC: Error: cannot pass argument '0' of type 'int' to parameter 'const(char)*'
- Bugzilla 22405: importC: Error: cannot modify 'const' expression '(*s).field'
- Bugzilla 22406: importC: Error: 'switch' statement without a 'default'; use 'final switch' or add 'default: assert(0);' or add 'default: break;'
- Bugzilla 22407: importC: Error: cannot implicitly convert expression of type 'extern (C) int(int a)' to 'const(extern (C) int function(int))'
- Bugzilla 22409: importC: [ICE] Error: struct no size because of forward reference
- Bugzilla 22411: importC: Error: cannot implicitly convert expression of type 'const(char*)' to 'char*'
- Bugzilla 22413: importC: Error: array index 0 is out of bounds
- Bugzilla 22415: importC: Deprecation: switch case fallthrough - use 'goto case;' if intended
- Bugzilla 22421: static foreach introduces semantic difference between indexing and iteration variable
- Bugzilla 22422: ImportC: parse gnu attributes after a function parameter
- Bugzilla 22428: importC: static variables/functions emit global symbols
- Bugzilla 22432: ImportC: casting result of postfix operator on a parenthesized expression to a typedef’d type is parsed incorrectly
- Bugzilla 22461: OpenBSD: Use fmodl
- Bugzilla 22462: OpenBSD: bash lives in /usr/local
- Bugzilla 22463: OpenBSD: Allow DMD to work on 32-bit OpenBSD
- Bugzilla 22467: DWARF: wchar_t reports wrong DECL attributes
- Bugzilla 22500: ImportC: Lots of errors when compiling tomlc99
- Bugzilla 22510: Structs with copy constructor can not be heap allocated with default constructor
- Bugzilla 22513: ImportC: address of member of struct can’t be taken at compile time.
- Bugzilla 22515: Aggregate definition with qualifiers has inconsistencies between structs and classes
- Bugzilla 22517: [REG 2.093][ICE] Bus error at dmd/lexer.d:398
- Bugzilla 22527: Casting out-of-range floating point value to signed integer overflows
- Bugzilla 22530: Explicit cast between classes incorrectly goes through 'alias this' inside CTFE
- Bugzilla 22531: importC: D name mangling applied to forward declaration of function inside function
- Bugzilla 22533: OpenBSD: Use correct size_t compat for 32-bit
- Bugzilla 22534: ImportC: const pointer (not pointer to const) is treated as transitive const
- Bugzilla 22535: ImportC: gcc/clang math intrinsics are rejected.
- Bugzilla 22538: importC: function 'func' conflicts with function 'func' when using static in forward declaration
- Bugzilla 22549: importC: float literal should support leading zero
- Bugzilla 22553: ImportC: undefined identifier __uint128_t
- Bugzilla 22560: ImportC: extra semicolon not allowed outside of functions
- Bugzilla 22566: Error: unknown architecture feature 4+avx for -target
- Bugzilla 22573: DMD compiler errors on Illumos/Solaris
- Bugzilla 22576: ImportC: cannot implicitly convert expression S(0) of type S to int in an S array
- Bugzilla 22577: ImportC: decay of function to typedef'd const function pointer causes ICE.
- Bugzilla 22589: importC: Error: undefined reference to '__builtin_va_start' and '__builtin_va_end'
- Bugzilla 22590: importC: static functions have no debug information generated for them
- Bugzilla 22591: importC: Debug information for C sources have DW_AT_language set to D.
- Bugzilla 22597: importC: Segmentation fault initializing va_list with __builtin_va_start
- Bugzilla 22598: importC: Add support for __extension__ keyword
- Bugzilla 22602: importC: Error: cannot convert string literal to 'void*'
- Bugzilla 22607: ImportC misses some float values ending with f
- Bugzilla 22619: Missing inout substitution for __copytmp temporaries caused by copy ctors
- Bugzilla 22623: ImportC: typedef'd struct definition tag not put in symbol table
- Bugzilla 22624: ImportC: struct members in static initializer misaligned following bit field
- Bugzilla 22625: ImportC: original name of typedefed struct not visible in D when compiling separately
- Bugzilla 22632: Crash happens when CTFE compares an associative array to null using ==
- Bugzilla 22634: assert for too many symbols should be error
- Bugzilla 22655: Disassembler assertion on rdtsc
- Bugzilla 22656: SSE2 instructions have inconsistent layouts in the disassembler output
- Bugzilla 22665: ImportC: qualified enum values should be of enum type on the D side, not int
- Bugzilla 22666: ImportC: Error: attributes should be specified before the function definition
- Bugzilla 22668: Deprecation when a deprecated method overrides another deprecated method
- Bugzilla 22685: Template function instantiated with lambda and overload is nested incorrectly
- Bugzilla 22686: ICE: dmd segfaults on invalid member reference in static function
- Bugzilla 22698: ImportC: nested struct tag stored in wrong scope
- Bugzilla 22699: importC: assignment cannot be used as a condition
- Bugzilla 22703: importC: C++11 unscoped enums with underlying type rejects some C types.
- Bugzilla 22708: switch statement with an undefined symbol results in many errors
- Bugzilla 22709: [dip1000] slice of static array can be escaped in @safe using ref arguments
- Bugzilla 22710: CTFE on bitfields does not account for field width
- Bugzilla 22713: ImportC: op= not correctly implemented for bit fields
- Bugzilla 22717: object.TypeInfo_Struct.equals swaps lhs and rhs parameters
- Bugzilla 22725: ImportC: segfault when compiling with -H
- Bugzilla 22726: ImportC: typedefs of tagged enums fail to compile
- Bugzilla 22727: ImportC: support for __stdcall and __fastcall is necessary for 32-bit Windows builds
- Bugzilla 22734: importC: typedef anonymous enum members not available when used from D
- Bugzilla 22749: importC: C11 does not allow taking the address of a bit-field
- Bugzilla 22756: ImportC: no __builtin_offsetof
- Bugzilla 22757: importC: typedef causes forward reference error
- Bugzilla 22758: ImportC: parenthesized expression confused with cast-expression
DMD Compiler enhancements
- Bugzilla 5096: More readable unpaired brace error
- Bugzilla 7925: extern(C++) delegates?
- Bugzilla 11008: Allow -main switch even if user-defined main function exists
- Bugzilla 20340: [betterC] -main inserts D main function even with betterC
- Bugzilla 20616: Error: undefined identifier __dollar
- Bugzilla 21160: DWARF: DW_AT_main_subprogram should be emitted for _Dmain
- Bugzilla 22113: Allow noreturn as a type for main function
- Bugzilla 22198: Compile time bounds checking for static arrays
- Bugzilla 22278: [Conditional Compilation] there should be in and out flags
- Bugzilla 22291: __traits(arguments) to return a tuple of the function arguments
- Bugzilla 22353: Header generation is producing trailing whitespace on attribute declarations
- Bugzilla 22354: Header generation is producing trailing whitespace on enum declarations
- Bugzilla 22355: LLD fallback for mscoff is broken in the presence of some old VS versions
- Bugzilla 22377: Show location for Windows extern(C++) mangling ICE
- Bugzilla 22379: OpenBSD: link -lexecinfo to get backtrace symbols
- Bugzilla 22419: Allow return type inference for main
- Bugzilla 22423: DWARF DW_TAG_subprogram should generate DW_AT_decl_column
- Bugzilla 22426: DWARF DW_AT_noreturn should be present when function is noreturn
- Bugzilla 22459: DWARF: delegate type names should be distinguishable
- Bugzilla 22468: DWARF: dchar type is missing encoding
- Bugzilla 22469: DWARF: some debug info types are named wrongly
- Bugzilla 22471: DWARF: generated main is not marked as DW_AT_artificial
- Bugzilla 22474: OpenBSD: Add support to test/runnable/dhry.d
- Bugzilla 22475: OpenBSD: Disable test/compilable/cdcmp.d on OpenBSD
- Bugzilla 22476: OpenBSD: Add OpenBSD to the fail_compilation/fail21227_win.d ignore list
- Bugzilla 22477: OpenBSD: Add to fail_compilation/fail3753.d ignore list
- Bugzilla 22478: OpenBSD: Add to fail_compilation/invalid_lib.d
- Bugzilla 22494: Search paths for dmd.conf missing from dmd man page
- Bugzilla 22508: DWARF: associative arrays should report qualified name instead of _AArray_
_ - Bugzilla 22519: [dip1000] cannot take address of ref return
- Bugzilla 22541: DIP1000: Resolve ambiguity of ref-return-scope parameters
- Bugzilla 22631: ImportC: support C++11 unscoped enums with underlying type
- Bugzilla 22672: Allow casting a ValueSeq to a compatible TypeTuple
- Bugzilla 22733: hdrgen generates inconsistent order of STC attributes for ~this()
- Bugzilla 22746: Functions that throws marked as nothrow produces bad error
- Bugzilla 22753: Deprecation message for import module shouldn't produce hifen when no message
- Bugzilla 22754: Header generator shouldn't generate trailing whitespace on visibility declaration
Phobos regression fixes
- Bugzilla 16705: [REG2.069] TaskPool.reduce fails to compile "cannot get frame pointer to D main"
Phobos bug fixes
- Bugzilla 17037: std.concurrency has random segfaults
- Bugzilla 19544: Can't call inputRangeObject on ranges not supported by moveFront
- Bugzilla 20554: std.algorithm.searching.all 's static assert produces a garbled error message
- Bugzilla 21022: std.range.only does not work with const
- Bugzilla 21457: std.functional.partial ignores function overloads
- Bugzilla 22105: std.container.array.Array.length setter creates values of init-less types
- Bugzilla 22185: std.array.array() doesn't handle throwing element copying
- Bugzilla 22249: std.experimental.checkedint: Warn.onLowerBound does not compile
- Bugzilla 22255: JSONValue.opBinaryRight!"in" is const
- Bugzilla 22297: Behavior of minElement and maxElement with empty range is undocumented
- Bugzilla 22301: Only use 'from' if a packet was actually received
- Bugzilla 22325: ReplaceType fails on templated type instantiated with void-returning function
- Bugzilla 22359: joiner over an empty forward range object liable to segfault
- Bugzilla 22364: Unreachable warning for collectException[Msg] with noreturn value
- Bugzilla 22368: has[Unshared]Aliasing fails to instantiate for noreturn
- Bugzilla 22369: Unreachable statements in std.concurrency with noreturn values / callbacks
- Bugzilla 22383: Array of bottom types not recognized as a range
- Bugzilla 22384: castSwitch confused by noreturn handlers
- Bugzilla 22386: Unreachable warning for assertThrown with noreturn value
- Bugzilla 22394: std.getopt cannot handle "-"
- Bugzilla 22408: Multiple issues in AllImplicitConversionTargets
- Bugzilla 22414: clamp(a, b, c) should always return typeof(a)
- Bugzilla 22458: OpenBSD: Add OpenBSD to std/system.d OS list
- Bugzilla 22487: Array!T.init.data crashes
- Bugzilla 22561: only().joiner fails with immutable element type
- Bugzilla 22572: Cannot define SumType over immutable struct with Nullable
- Bugzilla 22608: RandomAccessInfinite is not a valid random-access range
- Bugzilla 22647: [std.variant.Variant] Cannot compare types compliant with null comparison with 'null'
- Bugzilla 22648: [std.variant.Variant] Incorrectly written unittests
- Bugzilla 22673: .array of a range with length preallocates without checking if the length was lying or not.
- Bugzilla 22683: core.math.rndtonl can't be linked
- Bugzilla 22695: std.traits.isBuiltinType is false for typeof(null)
- Bugzilla 22704: Linker error when running the public unittests
- Bugzilla 22838: std.bitmanip.BitArray.count() reads beyond data when data size is integer size_t multiple
Phobos enhancements
- Bugzilla 13551: std.conv.to for std.typecons tuples too
- Bugzilla 17488: Platform-inconsistent behavior from getTempDir()
- Bugzilla 18051: missing enum support in formattedRead/unformatValue
- Bugzilla 21507: SysTime.toISOExtString is unusable for logging or consistent filename creation
- Bugzilla 22117: Can't store scope pointer in a SumType
- Bugzilla 22340: totalCPUs may not return accurate number of CPUs
- Bugzilla 22370: std.concurrency.spawn* should accept noreturn callables
- Bugzilla 22393: OpenBSD: Add polyImpl implementation for x86
- Bugzilla 22488: data should work with const/immutable Array's
- Bugzilla 22511: Nullable is not copyable when templated type has elaborate copy ctor
- Bugzilla 22532: std.experimental.logger Change default log level to LogLevel.warning, or LogLevel.off
- Bugzilla 22557: std.traits.fqnType is missing support for typeof(null)
- Bugzilla 22701: std.typecons.apply needlessly checks if the predicate is callable
Druntime regression fixes
- Bugzilla 21656: [REG2.091] Wrong file read during exception stringification leads to SIGBUS
- Bugzilla 22136: [REG 2.097.1] hashOf failed to compile because of different inheritance order
- Bugzilla 22210: std.meta.allSatisfy in mutual recursion classes cannot be compiled
- Bugzilla 22235: core.demangle does not support noreturn
Druntime bug fixes
- Bugzilla 21919: darwin: SEGV in core.thread tests on OSX 11
- Bugzilla 22328: Specific D types are used instead of Windows type aliases
- Bugzilla 22336: core.lifetime.move doesn't work with betterC on elaborate non zero structs
- Bugzilla 22416: Unify polyImpl implementations
- Bugzilla 22440: OpenBSD: Sync sysctl.d
- Bugzilla 22443: OpenBSD: Fix Fiber support by adding MAP_STACK
- Bugzilla 22453: OpenBSD: Add a dummy value for AI_V4MAPPED
- Bugzilla 22455: Remove useless conditional assignment of DISABLED_TESTS in posix.mak
- Bugzilla 22456: OpenBSD: timer_* functions don't exist on OpenBSD
- Bugzilla 22485: OpenBSD: Fix core.sys.openbsd.unistd imports
- Bugzilla 22523: DRuntime options passed after -- affect current process
- Bugzilla 22552: moveEmplace wipes context pointer of nested struct contained in non-nested struct
- Bugzilla 22630: It is possible for VS to be installed and providing VC directory without VC libraries being installed
- Bugzilla 22702: druntime not compliant with D spec re getLinkage
- Bugzilla 22721: importC: some gnu builtins are rejected
- Bugzilla 22735: __builtins.di does not implement __builtin_bswap64 correctly
- Bugzilla 22741: importC: Error: bswap isn’t a template
- Bugzilla 22744: ImportC: builtins defined in __builtins.di cause undefined symbol linker errors.
- Bugzilla 22777: stat struct in core.sys.windows.stat assumes CRuntime_DigitalMars
- Bugzilla 22779: druntime: Calling __delete with null pointer-to-struct segfaults
Druntime enhancements
- Bugzilla 14892: -profile=gc doesn't account for GC API allocations
- Bugzilla 20936: core.sync.rwmutex should have shared overloads (and make it usable in @safe code)
- Bugzilla 21005: Speed up hashOf for associative arrays
- Bugzilla 21014: aa.byKeyValue, byKey, byValue very under-documented
- Bugzilla 22378: OpenBSD: execinfo.d and unistd.d aren't being installed
- Bugzilla 22395: OpenBSD: Add more OpenBSD-specific function prototypes in string.d and unistd.d
- Bugzilla 22439: OpenBSD: Sync mman.d
- Bugzilla 22448: OpenBSD: Add OpenBSD-specific alloc and free function prototypes from stdlib.h
- Bugzilla 22454: OpenBSD: Add prototypes for pthread_np.h
- Bugzilla 22457: OpenBSD: enableDwarf in opApply in runtime.d
- Bugzilla 22542: Explicitly cast backtrace results to int
- Bugzilla 22545: OpenBSD: Always use system backtrace
- Bugzilla 22669: OpenBSD: Sync socket.d
- Bugzilla 22670: Support *BSD kqueue-backed API-compatible inotify shim library
dlang.org bug fixes
- Bugzilla 19136: is expressions don't work as documented
- Bugzilla 21717: [Oh No! Page Not Found]
- Bugzilla 22064: Missing documentation page for phobos core.builtins
- Bugzilla 22281: unreadable quotes in the upcoming 2.099 changelog
- Bugzilla 22363: Wrong link in https://dlang.org/spec/abi.html for "Garbage Collection"
- Bugzilla 22417: Slice assignment operator overloading example is incorrect
- Bugzilla 22504: spec/type.html: 6.1 Basic Data Types: Backslash missing in default value for {,d,w}char
- Bugzilla 22518: [dip1000] return without scope/ref not specified
- Bugzilla 22544: [spec] C++ and Objective-C are not single tokens
- Bugzilla 22692: Underground Rekordz link is dead
- Bugzilla 22711: Effect of template UDAs on instance members is undocumented
dlang.org enhancements
- Bugzilla 22425: Documentation on implicit conversion of arrays is incomplete
- Bugzilla 22431: Add OpenBSD to Third-party downloads list
Installer enhancements
- Bugzilla 18362: Build dmd with LTO and PGO
- Bugzilla 22078: install.sh: Recognize ARM64 as architecture
Contributors to this release (101)
A huge thanks goes to all the awesome people who made this release possible.
- 12345swordy
- Adam D. Ruppe
- aG0aep6G
- Andrei Alexandrescu
- Andrej Petrović
- Anton Curmanschii
- Antonio Cabrera
- Arun Chandrasekaran
- Ate Eskola
- Atila Neves
- BarrOff
- Bastiaan Veelo
- Ben Jones
- Bianca Fodor
- bistcuite
- Boris Carvajal
- Brian Callahan
- David Gileadi
- Dennis
- dkorpel
- DoctorNoobingstoneIPresume
- Domenico Teodonio
- Dorian Verna
- dorianverna17
- dteod
- Eddy Schauman-Haigh
- Eduard Staniloiu
- etienne02
- Florian
- fourst4r
- Gabriel
- Gabriel Dolberg
- giacomo.ratto00
- H. S. Teoh
- Harrison
- Harry T. Vennik
- Hasan Kashi
- Hiroki Noda
- human
- Iain Buclaw
- Ilya Yaroshenko
- Imperatorn
- James S Blachly
- Jan Jurzitza
- Jeremy DeHaan
- Johan Engelen
- John Colvin
- John Kilpatrick
- João Lourenço
- jpiles
- jrfondren
- Julian Fondren
- Laeeth Isharc
- Lionello Lunesu
- Lio李歐
- lucica28
- Lucien Perregaux
- Luís Ferreira
- Manu Evans
- Marcelo Silva Nascimento Mancini
- Martin Kinkelin
- Martin Nowak
- Mathias Lang
- Mathis Beer
- Max H Haughton
- Max Haughton
- Max Samukha
- Mike Parker
- MoonlightSentinel
- Nathan Sashihara
- Nicholas Wilson
- Nick Treleaven
- Paul Backus
- Per Nordlöw
- Petar Kirov
- quassy
- Razvan Nitu
- Richard Andrew Cattermole
- rikki cattermole
- Robert burner Schadek
- Ryan Frame
- Sebastian Wilzbach
- Sebastien Alaiwan
- sorin-gabriel
- Stanislav Blinov
- Stefan Koch
- Sönke Ludwig
- teo
- Teodor Dutu
- thaven
- Tim Schendekehl
- tim-dlang
- Tobias Pankrath
- Tomoya Tanjo
- Tomáš Chaloupka
- Victarus
- Vladimir Panteleev
- Walter Bright
- Walter Waldron
- wolframw
- Ömer Faruk IRMAK