Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

Change Log: 2.099.0

previous version: 2.098.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


2.099.0 comes with 19 major changes and 322 fixed Bugzilla issues. A huge thanks goes to the 101 contributors who made 2.099.0 possible.

List of all upcoming bug fixes and enhancements in D 2.099.0.

Compiler changes

  1. 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.

  2. 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

    DStep code

    DStep Article

    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

    dpp code

    dpp Article

    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:

    1. Compile C code directly, but only C code that has already been run through
    the C preprocessor. To import stdio.h into a D program, the build script would be:

    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.

    1. A C compiler front end, stripped of its integrated preprocessor, is a simple
    beast. It could be compiled directly into dmd's internal data structure types.

    1. The D part of dmd will have no idea it originated as C code. It would be
    just another import. There is no change whatsoever to D.

    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.
    Only the first error message is likely to be on point.

    • Pretty-printing code is done in D syntax, not C. Also,
    differing precedence for Relational/Equality expressions.

    • No warnings are emitted. ImportC doesn't care about coding style,
    best practices or suspicious constructs. If ISO C says it's good, it passes.

    • If the ImportC code corrupts memory, overflows buffers, etc.,
    it will still compile. Use DasBetterC for a better way.

    • Symbolic debugging support is there.

    Variance From ISO C11

    • Doesn't have a C Preprocessor.
    The C code must be run through a preprocessor before it can be processed by ImportC. Incorporating this into your build system is advisable.

    • Tag symbols are part of the global symbol table, not the special tag
    symbol table like they are supposed to reside in.

    • 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
    value can be declared, but it'll be treated as a pointer to a const pointer to a const value.

    • { 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
    during semantic processing, not just the ones lexically prior to the piece of code it is working on.

    • Semantics applied after C parsing are D semantics, not C semantics,
    although they are very close. For example, implicitly converting an int to a char will pass C without complaint, but the D semantic pass will issue an error.

    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
    the same as D's real type.

    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.
    None of these are implemented.

    • 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.

  3. 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 */ }.

  4. 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.

  5. -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.

  6. 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);
    
  7. 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.

  8. 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.

  9. 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.

  10. 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.

  11. 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_6464 bit
    x6464 bit
    x8632 bit
    x3264bit with 32 bit pointers

    subarch featuresequivalent -mcpu flag
    +sse2baseline
    +avxavx
    +avx2avx2

    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
    freestandingNo operating system
    darwinMacOS
    dragonflyDragonflyBSD
    freebsdFreeBSD
    openbsdOpenBSD
    linuxLinux
    solarisSolaris
    windowsWindows

    <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.

    <cenv>C runtime environmentDefault for OS
    muslmusl-libc
    msvcMSVC runtimeWindows
    bionicAndriod libc
    digital_marsDigital Mars C runtime for Windows
    | glibc | GCC C runtime | linux | | newlib | Newlib Libc | | | uclibc | uclibc | |

    <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 environmentDefault for OS
    clangLLVM C++ runtimeMacOS, FreeBSD, OpenBSD, DragonflyBSD
    gccGCC C++ runtimelinux
    msvcMSVC runtimeWindows
    digital_marsDigital Mars C++ runtime for Windows
    sunSun C++ runtimeSolaris

  12. 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

  1. 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.

  2. 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.

  3. 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

  1. 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

  1. 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.

  2. 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"
        ],
    
  3. 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

  1. Bugzilla 17635: [REG 2.066.0] cannot convert unique immutable(int)** to immutable
  2. Bugzilla 20133: [REG2.084.0] Bogus slice assignment in recursive CTFE call
  3. Bugzilla 20236: spurious deprecation warnings on function calls within with(X) blocks while X has a deprecated alias this target
  4. Bugzilla 20860: OpDispatch does not work for structs with constructor and destructor
  5. Bugzilla 20998: error in static struct initialization causes wrong position for subsequent members, producing extra errors
  6. Bugzilla 21039: alias this returns 'null' for ref types when put into array initializer
  7. Bugzilla 21073: Rebindable does not work when class has alias this to inout property
  8. Bugzilla 21367: Nameless union propagates copy constructors and destructors over all members
  9. Bugzilla 21380: A case of compiler crash when using auto ref
  10. Bugzilla 21414: Spurious "non-constant expression" error with immutable constructors
  11. Bugzilla 21438: Compiler segfault on static array in a struct at CTFE
  12. Bugzilla 21538: Overriding with more attributes on delegate parameter is allowed
  13. Bugzilla 21674: [REG v2.086] alias this triggers wrong deprecation message on function call
  14. Bugzilla 21719: [REG 2.072] "auto" methods of classes do not infer attributes correctly.
  15. Bugzilla 22004: [REG2.097] Error: mismatched function return type inference of void and noreturn
  16. Bugzilla 22130: [REG2.080.1][DIP1000] pure factory functions stopped working
  17. Bugzilla 22151: Compiler crash when attempting to assign to function
  18. Bugzilla 22163: [REG 2.094.0] wrong code with static float array and delegate accessing it
  19. Bugzilla 22226: [REG 2.095.1] __ctfe + function call in conditional expression used to initialize struct member in constructor causes ICE
  20. Bugzilla 22254: Template instantiated twice results in different immutable qualifier
  21. Bugzilla 22300: [REG 2.098-rc.2] -checkaction=context of a shared type with an opCast fails to compile
  22. Bugzilla 22385: CTFE fails to iterate over associative array previously indexed with implicit conversion to enum base type
  23. Bugzilla 22410: [REG2.094] function with tuple parameter with default argument fails if there's a qualifier
  24. Bugzilla 22420: [REG2.098] Apparent CTFE regression wrt. alias this
  25. Bugzilla 22472: Invalid error message for void return from non-void functions
  26. Bugzilla 22512: importC: incomplete array type must have initializer
  27. Bugzilla 22514: Invalid duplicate case error when the switched value has errors
  28. Bugzilla 22516: Segfault for function literal in struct initializer with previous errors
  29. Bugzilla 22529: wrong deprecation about empty statement
  30. 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)'
  31. Bugzilla 22570: more arguments than fields allowed in struct constructor
  32. Bugzilla 22584: importC: Error: undefined reference to 'parameter' when no parameter names in forward declaration
  33. Bugzilla 22585: importC: Error: variable 'var' extern symbols cannot have initializers
  34. Bugzilla 22592: importC: Segmentation fault indexing global array at run-time
  35. Bugzilla 22593: ICE on overloaded constructors
  36. Bugzilla 22659: [REG master] Error: declaration '(S[2] arr = __error__;)' is not yet implemented in CTFE
  37. Bugzilla 22676: fullyQualifiedName fails to compile with 2.098.1 relese -- there is some issue with call to __traits(isScalar ..
  38. Bugzilla 22705: importC: forward reference to struct typedef gives struct already exists
  39. Bugzilla 22714: ICE: Assertion failure in ClassDeclaration::isBaseOf
  40. Bugzilla 22730: master: "dmd -i" doesn't include unit tests from imported modules
  41. Bugzilla 22738: std.file.tempDir adds an addition / even when it already has one
  42. Bugzilla 22761: [REG 2.099] importC: Error: redeclaration with different type
  43. Bugzilla 22780: [REG 2.090] variable reference to scope class must be scope
  44. Bugzilla 22804: [REG 2.099] compiling multiple files without linking produces broken object files
  45. Bugzilla 22816: [REG 2.099] Parser reads files with other extensions
  46. Bugzilla 22817: [REG 2.099] Missing file gives misleading error message
  47. Bugzilla 22826: [REG 2.098] #line accepts importC linemarker flags

DMD Compiler bug fixes

  1. Bugzilla 2: Hook up new dmd command line arguments
  2. Bugzilla 3: Finish or remove MatchExp::toElem
  3. Bugzilla 3818: Generic error message for wrong foreach
  4. Bugzilla 8346: Literals 00 - 07 results in odd errors when used with UFCS
  5. Bugzilla 10584: Unhelpful error default constructing nested class
  6. Bugzilla 15711: Incorrect type inferring of [char]/string when passed via recursive template, extracting it from a structure field
  7. Bugzilla 15804: missing UDAs on nested struct template
  8. Bugzilla 16579: ReturnStatement[CallExp(DotVarExp)]: Corrupted runtime on missed manifest constant propagation
  9. Bugzilla 17870: Can't alias a mix of parent and child class members
  10. Bugzilla 17977: [DIP1000] destructor allows escaping reference to a temporary struct instance
  11. Bugzilla 18054: Wrong cast of float constant to bool
  12. Bugzilla 18960: Function parameter requires name with default value
  13. Bugzilla 19320: -cov and -O yield variable used before set
  14. Bugzilla 19482: attributes incorrectly applied to static foreach local variables
  15. Bugzilla 19660: 'export' keyword on OSX/Linux globals causing segfaults
  16. Bugzilla 19873: function should be by default @system even with -preview=dip1000
  17. Bugzilla 20023: Separate compilation breaks dip1000 / dip1008 @safety
  18. Bugzilla 20691: Converting scope static array to scope dynamic array should be error
  19. Bugzilla 20777: User defined type as enum base type fails to compile.
  20. Bugzilla 20904: dip1000 implicit conversion delegates error
  21. Bugzilla 21093: [ICE] AssertError@dmd/optimize.d(691): Assertion failure
  22. Bugzilla 21431: Incorrect maximum and actual number of cases in a switch case range is reported
  23. Bugzilla 21794: Internal compiler assertion
  24. Bugzilla 21844: makedeps option adds spurious/incorrect dependency
  25. Bugzilla 21930: ICE (illegal instruction) with bad code
  26. Bugzilla 21950: cod1: Assertion failure for noreturn parameter
  27. Bugzilla 21952: ice for global / tls variable of type noreturn
  28. Bugzilla 21957: ice when dmd computes the alignment of an union containing a noreturn
  29. Bugzilla 21969: importC: Error: bit fields are not supported
  30. Bugzilla 22104: importC: Parser accepts arrays with incomplete element types
  31. Bugzilla 22124: Corrupted closure when compiling with -preview=dip1000
  32. Bugzilla 22127: compiler assertion failure parser on UDA and function literal
  33. Bugzilla 22137: -preview=dip1000 enables visibility checks for tupleof
  34. Bugzilla 22139: Compiler special cases object.dup when compiling with -preview=dip1000
  35. Bugzilla 22233: importC: (identifier)() incorrectly parsed as a cast-expression
  36. Bugzilla 22236: sizeof an empty C struct should be 0, not 1
  37. Bugzilla 22245: importC: Error: found . when expecting )
  38. Bugzilla 22267: ImportC: typedef-ed variable initialization with RHS in parenthesis doesn't parse
  39. Bugzilla 22277: removing strongly pure function calls is an incorrect optimization
  40. Bugzilla 22283: -preview=in -inline leads to strange error inside object.d
  41. Bugzilla 22285: markdown tables are not parsed correctly
  42. Bugzilla 22287: ambiguous virtual function for extern(C++) under Windows
  43. Bugzilla 22298: [DIP1000] Nested function's scope parameters can be assigned to variables in enclosing function
  44. Bugzilla 22305: ImportC: #pragma STDC FENV_ACCESS is not supported
  45. Bugzilla 22311: dmd slice length is wrong on DWARF
  46. Bugzilla 22315: ImportC: #pragma pack is not implemented
  47. Bugzilla 22323: Link error for virtual destructor of C++ class in DLL
  48. Bugzilla 22339: importC: error message with character literal reports as integer instead of character literal.
  49. Bugzilla 22342: importC: Error: function 'func()' is not callable using argument types '(int)'
  50. Bugzilla 22344: ImportC: overloading of functions is not allowed
  51. Bugzilla 22356: Can't mixin the return type of a function
  52. Bugzilla 22361: Failed import gives misleading error message
  53. Bugzilla 22362: ImportC: error parsing compound literal with more than one value at function scope.
  54. Bugzilla 22365: Compiler crash: tcs.body_ null in StatementSemanticVisitor.visit(TryCatchStatement) in semantic3 pass (dmd/statementsem.d:3956)
  55. Bugzilla 22366: [dip1000] scope variable can be assigned to associative array
  56. Bugzilla 22372: Loop index incorrectly optimised out for -release -O
  57. Bugzilla 22375: importC: Error: C non-array initializer not supported yet
  58. Bugzilla 22376: importC: Error: cannot use non-constant CTFE pointer in an initializer
  59. Bugzilla 22387: Noreturn init loses type qualifiers
  60. Bugzilla 22388: Wrong overload selected for @safe delegate
  61. Bugzilla 22389: noreturn functions are allowed to return normally
  62. Bugzilla 22398: importC: Error: unknown, when compiling source with non-constant initializer.
  63. Bugzilla 22399: importC: Error: static variable cannot be read at compile time
  64. Bugzilla 22400: importC: Error: unknown, when compiling source with typedef'd initializer
  65. Bugzilla 22401: importC: Error: cannot implicitly convert expression of type 'const(int[1])' to 'const(int*)'
  66. Bugzilla 22402: importC: Error: can't subtract '__tag2[1]' from pointer
  67. Bugzilla 22403: importC: Error: cannot pass argument '0' of type 'int' to parameter 'const(char)*'
  68. Bugzilla 22405: importC: Error: cannot modify 'const' expression '(*s).field'
  69. Bugzilla 22406: importC: Error: 'switch' statement without a 'default'; use 'final switch' or add 'default: assert(0);' or add 'default: break;'
  70. Bugzilla 22407: importC: Error: cannot implicitly convert expression of type 'extern (C) int(int a)' to 'const(extern (C) int function(int))'
  71. Bugzilla 22409: importC: [ICE] Error: struct no size because of forward reference
  72. Bugzilla 22411: importC: Error: cannot implicitly convert expression of type 'const(char*)' to 'char*'
  73. Bugzilla 22413: importC: Error: array index 0 is out of bounds
  74. Bugzilla 22415: importC: Deprecation: switch case fallthrough - use 'goto case;' if intended
  75. Bugzilla 22421: static foreach introduces semantic difference between indexing and iteration variable
  76. Bugzilla 22422: ImportC: parse gnu attributes after a function parameter
  77. Bugzilla 22428: importC: static variables/functions emit global symbols
  78. Bugzilla 22432: ImportC: casting result of postfix operator on a parenthesized expression to a typedef’d type is parsed incorrectly
  79. Bugzilla 22461: OpenBSD: Use fmodl
  80. Bugzilla 22462: OpenBSD: bash lives in /usr/local
  81. Bugzilla 22463: OpenBSD: Allow DMD to work on 32-bit OpenBSD
  82. Bugzilla 22467: DWARF: wchar_t reports wrong DECL attributes
  83. Bugzilla 22500: ImportC: Lots of errors when compiling tomlc99
  84. Bugzilla 22510: Structs with copy constructor can not be heap allocated with default constructor
  85. Bugzilla 22513: ImportC: address of member of struct can’t be taken at compile time.
  86. Bugzilla 22515: Aggregate definition with qualifiers has inconsistencies between structs and classes
  87. Bugzilla 22517: [REG 2.093][ICE] Bus error at dmd/lexer.d:398
  88. Bugzilla 22527: Casting out-of-range floating point value to signed integer overflows
  89. Bugzilla 22530: Explicit cast between classes incorrectly goes through 'alias this' inside CTFE
  90. Bugzilla 22531: importC: D name mangling applied to forward declaration of function inside function
  91. Bugzilla 22533: OpenBSD: Use correct size_t compat for 32-bit
  92. Bugzilla 22534: ImportC: const pointer (not pointer to const) is treated as transitive const
  93. Bugzilla 22535: ImportC: gcc/clang math intrinsics are rejected.
  94. Bugzilla 22538: importC: function 'func' conflicts with function 'func' when using static in forward declaration
  95. Bugzilla 22549: importC: float literal should support leading zero
  96. Bugzilla 22553: ImportC: undefined identifier __uint128_t
  97. Bugzilla 22560: ImportC: extra semicolon not allowed outside of functions
  98. Bugzilla 22566: Error: unknown architecture feature 4+avx for -target
  99. Bugzilla 22573: DMD compiler errors on Illumos/Solaris
  100. Bugzilla 22576: ImportC: cannot implicitly convert expression S(0) of type S to int in an S array
  101. Bugzilla 22577: ImportC: decay of function to typedef'd const function pointer causes ICE.
  102. Bugzilla 22589: importC: Error: undefined reference to '__builtin_va_start' and '__builtin_va_end'
  103. Bugzilla 22590: importC: static functions have no debug information generated for them
  104. Bugzilla 22591: importC: Debug information for C sources have DW_AT_language set to D.
  105. Bugzilla 22597: importC: Segmentation fault initializing va_list with __builtin_va_start
  106. Bugzilla 22598: importC: Add support for __extension__ keyword
  107. Bugzilla 22602: importC: Error: cannot convert string literal to 'void*'
  108. Bugzilla 22607: ImportC misses some float values ending with f
  109. Bugzilla 22619: Missing inout substitution for __copytmp temporaries caused by copy ctors
  110. Bugzilla 22623: ImportC: typedef'd struct definition tag not put in symbol table
  111. Bugzilla 22624: ImportC: struct members in static initializer misaligned following bit field
  112. Bugzilla 22625: ImportC: original name of typedefed struct not visible in D when compiling separately
  113. Bugzilla 22632: Crash happens when CTFE compares an associative array to null using ==
  114. Bugzilla 22634: assert for too many symbols should be error
  115. Bugzilla 22655: Disassembler assertion on rdtsc
  116. Bugzilla 22656: SSE2 instructions have inconsistent layouts in the disassembler output
  117. Bugzilla 22665: ImportC: qualified enum values should be of enum type on the D side, not int
  118. Bugzilla 22666: ImportC: Error: attributes should be specified before the function definition
  119. Bugzilla 22668: Deprecation when a deprecated method overrides another deprecated method
  120. Bugzilla 22685: Template function instantiated with lambda and overload is nested incorrectly
  121. Bugzilla 22686: ICE: dmd segfaults on invalid member reference in static function
  122. Bugzilla 22698: ImportC: nested struct tag stored in wrong scope
  123. Bugzilla 22699: importC: assignment cannot be used as a condition
  124. Bugzilla 22703: importC: C++11 unscoped enums with underlying type rejects some C types.
  125. Bugzilla 22708: switch statement with an undefined symbol results in many errors
  126. Bugzilla 22709: [dip1000] slice of static array can be escaped in @safe using ref arguments
  127. Bugzilla 22710: CTFE on bitfields does not account for field width
  128. Bugzilla 22713: ImportC: op= not correctly implemented for bit fields
  129. Bugzilla 22717: object.TypeInfo_Struct.equals swaps lhs and rhs parameters
  130. Bugzilla 22725: ImportC: segfault when compiling with -H
  131. Bugzilla 22726: ImportC: typedefs of tagged enums fail to compile
  132. Bugzilla 22727: ImportC: support for __stdcall and __fastcall is necessary for 32-bit Windows builds
  133. Bugzilla 22734: importC: typedef anonymous enum members not available when used from D
  134. Bugzilla 22749: importC: C11 does not allow taking the address of a bit-field
  135. Bugzilla 22756: ImportC: no __builtin_offsetof
  136. Bugzilla 22757: importC: typedef causes forward reference error
  137. Bugzilla 22758: ImportC: parenthesized expression confused with cast-expression

DMD Compiler enhancements

  1. Bugzilla 5096: More readable unpaired brace error
  2. Bugzilla 7925: extern(C++) delegates?
  3. Bugzilla 11008: Allow -main switch even if user-defined main function exists
  4. Bugzilla 20340: [betterC] -main inserts D main function even with betterC
  5. Bugzilla 20616: Error: undefined identifier __dollar
  6. Bugzilla 21160: DWARF: DW_AT_main_subprogram should be emitted for _Dmain
  7. Bugzilla 22113: Allow noreturn as a type for main function
  8. Bugzilla 22198: Compile time bounds checking for static arrays
  9. Bugzilla 22278: [Conditional Compilation] there should be in and out flags
  10. Bugzilla 22291: __traits(arguments) to return a tuple of the function arguments
  11. Bugzilla 22353: Header generation is producing trailing whitespace on attribute declarations
  12. Bugzilla 22354: Header generation is producing trailing whitespace on enum declarations
  13. Bugzilla 22355: LLD fallback for mscoff is broken in the presence of some old VS versions
  14. Bugzilla 22377: Show location for Windows extern(C++) mangling ICE
  15. Bugzilla 22379: OpenBSD: link -lexecinfo to get backtrace symbols
  16. Bugzilla 22419: Allow return type inference for main
  17. Bugzilla 22423: DWARF DW_TAG_subprogram should generate DW_AT_decl_column
  18. Bugzilla 22426: DWARF DW_AT_noreturn should be present when function is noreturn
  19. Bugzilla 22459: DWARF: delegate type names should be distinguishable
  20. Bugzilla 22468: DWARF: dchar type is missing encoding
  21. Bugzilla 22469: DWARF: some debug info types are named wrongly
  22. Bugzilla 22471: DWARF: generated main is not marked as DW_AT_artificial
  23. Bugzilla 22474: OpenBSD: Add support to test/runnable/dhry.d
  24. Bugzilla 22475: OpenBSD: Disable test/compilable/cdcmp.d on OpenBSD
  25. Bugzilla 22476: OpenBSD: Add OpenBSD to the fail_compilation/fail21227_win.d ignore list
  26. Bugzilla 22477: OpenBSD: Add to fail_compilation/fail3753.d ignore list
  27. Bugzilla 22478: OpenBSD: Add to fail_compilation/invalid_lib.d
  28. Bugzilla 22494: Search paths for dmd.conf missing from dmd man page
  29. Bugzilla 22508: DWARF: associative arrays should report qualified name instead of _AArray__
  30. Bugzilla 22519: [dip1000] cannot take address of ref return
  31. Bugzilla 22541: DIP1000: Resolve ambiguity of ref-return-scope parameters
  32. Bugzilla 22631: ImportC: support C++11 unscoped enums with underlying type
  33. Bugzilla 22672: Allow casting a ValueSeq to a compatible TypeTuple
  34. Bugzilla 22733: hdrgen generates inconsistent order of STC attributes for ~this()
  35. Bugzilla 22746: Functions that throws marked as nothrow produces bad error
  36. Bugzilla 22753: Deprecation message for import module shouldn't produce hifen when no message
  37. Bugzilla 22754: Header generator shouldn't generate trailing whitespace on visibility declaration

Phobos regression fixes

  1. Bugzilla 16705: [REG2.069] TaskPool.reduce fails to compile "cannot get frame pointer to D main"

Phobos bug fixes

  1. Bugzilla 17037: std.concurrency has random segfaults
  2. Bugzilla 19544: Can't call inputRangeObject on ranges not supported by moveFront
  3. Bugzilla 20554: std.algorithm.searching.all 's static assert produces a garbled error message
  4. Bugzilla 21022: std.range.only does not work with const
  5. Bugzilla 21457: std.functional.partial ignores function overloads
  6. Bugzilla 22105: std.container.array.Array.length setter creates values of init-less types
  7. Bugzilla 22185: std.array.array() doesn't handle throwing element copying
  8. Bugzilla 22249: std.experimental.checkedint: Warn.onLowerBound does not compile
  9. Bugzilla 22255: JSONValue.opBinaryRight!"in" is const
  10. Bugzilla 22297: Behavior of minElement and maxElement with empty range is undocumented
  11. Bugzilla 22301: Only use 'from' if a packet was actually received
  12. Bugzilla 22325: ReplaceType fails on templated type instantiated with void-returning function
  13. Bugzilla 22359: joiner over an empty forward range object liable to segfault
  14. Bugzilla 22364: Unreachable warning for collectException[Msg] with noreturn value
  15. Bugzilla 22368: has[Unshared]Aliasing fails to instantiate for noreturn
  16. Bugzilla 22369: Unreachable statements in std.concurrency with noreturn values / callbacks
  17. Bugzilla 22383: Array of bottom types not recognized as a range
  18. Bugzilla 22384: castSwitch confused by noreturn handlers
  19. Bugzilla 22386: Unreachable warning for assertThrown with noreturn value
  20. Bugzilla 22394: std.getopt cannot handle "-"
  21. Bugzilla 22408: Multiple issues in AllImplicitConversionTargets
  22. Bugzilla 22414: clamp(a, b, c) should always return typeof(a)
  23. Bugzilla 22458: OpenBSD: Add OpenBSD to std/system.d OS list
  24. Bugzilla 22487: Array!T.init.data crashes
  25. Bugzilla 22561: only().joiner fails with immutable element type
  26. Bugzilla 22572: Cannot define SumType over immutable struct with Nullable
  27. Bugzilla 22608: RandomAccessInfinite is not a valid random-access range
  28. Bugzilla 22647: [std.variant.Variant] Cannot compare types compliant with null comparison with 'null'
  29. Bugzilla 22648: [std.variant.Variant] Incorrectly written unittests
  30. Bugzilla 22673: .array of a range with length preallocates without checking if the length was lying or not.
  31. Bugzilla 22683: core.math.rndtonl can't be linked
  32. Bugzilla 22695: std.traits.isBuiltinType is false for typeof(null)
  33. Bugzilla 22704: Linker error when running the public unittests
  34. Bugzilla 22838: std.bitmanip.BitArray.count() reads beyond data when data size is integer size_t multiple

Phobos enhancements

  1. Bugzilla 13551: std.conv.to for std.typecons tuples too
  2. Bugzilla 17488: Platform-inconsistent behavior from getTempDir()
  3. Bugzilla 18051: missing enum support in formattedRead/unformatValue
  4. Bugzilla 21507: SysTime.toISOExtString is unusable for logging or consistent filename creation
  5. Bugzilla 22117: Can't store scope pointer in a SumType
  6. Bugzilla 22340: totalCPUs may not return accurate number of CPUs
  7. Bugzilla 22370: std.concurrency.spawn* should accept noreturn callables
  8. Bugzilla 22393: OpenBSD: Add polyImpl implementation for x86
  9. Bugzilla 22488: data should work with const/immutable Array's
  10. Bugzilla 22511: Nullable is not copyable when templated type has elaborate copy ctor
  11. Bugzilla 22532: std.experimental.logger Change default log level to LogLevel.warning, or LogLevel.off
  12. Bugzilla 22557: std.traits.fqnType is missing support for typeof(null)
  13. Bugzilla 22701: std.typecons.apply needlessly checks if the predicate is callable

Druntime regression fixes

  1. Bugzilla 21656: [REG2.091] Wrong file read during exception stringification leads to SIGBUS
  2. Bugzilla 22136: [REG 2.097.1] hashOf failed to compile because of different inheritance order
  3. Bugzilla 22210: std.meta.allSatisfy in mutual recursion classes cannot be compiled
  4. Bugzilla 22235: core.demangle does not support noreturn

Druntime bug fixes

  1. Bugzilla 21919: darwin: SEGV in core.thread tests on OSX 11
  2. Bugzilla 22328: Specific D types are used instead of Windows type aliases
  3. Bugzilla 22336: core.lifetime.move doesn't work with betterC on elaborate non zero structs
  4. Bugzilla 22416: Unify polyImpl implementations
  5. Bugzilla 22440: OpenBSD: Sync sysctl.d
  6. Bugzilla 22443: OpenBSD: Fix Fiber support by adding MAP_STACK
  7. Bugzilla 22453: OpenBSD: Add a dummy value for AI_V4MAPPED
  8. Bugzilla 22455: Remove useless conditional assignment of DISABLED_TESTS in posix.mak
  9. Bugzilla 22456: OpenBSD: timer_* functions don't exist on OpenBSD
  10. Bugzilla 22485: OpenBSD: Fix core.sys.openbsd.unistd imports
  11. Bugzilla 22523: DRuntime options passed after -- affect current process
  12. Bugzilla 22552: moveEmplace wipes context pointer of nested struct contained in non-nested struct
  13. Bugzilla 22630: It is possible for VS to be installed and providing VC directory without VC libraries being installed
  14. Bugzilla 22702: druntime not compliant with D spec re getLinkage
  15. Bugzilla 22721: importC: some gnu builtins are rejected
  16. Bugzilla 22735: __builtins.di does not implement __builtin_bswap64 correctly
  17. Bugzilla 22741: importC: Error: bswap isn’t a template
  18. Bugzilla 22744: ImportC: builtins defined in __builtins.di cause undefined symbol linker errors.
  19. Bugzilla 22777: stat struct in core.sys.windows.stat assumes CRuntime_DigitalMars
  20. Bugzilla 22779: druntime: Calling __delete with null pointer-to-struct segfaults

Druntime enhancements

  1. Bugzilla 14892: -profile=gc doesn't account for GC API allocations
  2. Bugzilla 20936: core.sync.rwmutex should have shared overloads (and make it usable in @safe code)
  3. Bugzilla 21005: Speed up hashOf for associative arrays
  4. Bugzilla 21014: aa.byKeyValue, byKey, byValue very under-documented
  5. Bugzilla 22378: OpenBSD: execinfo.d and unistd.d aren't being installed
  6. Bugzilla 22395: OpenBSD: Add more OpenBSD-specific function prototypes in string.d and unistd.d
  7. Bugzilla 22439: OpenBSD: Sync mman.d
  8. Bugzilla 22448: OpenBSD: Add OpenBSD-specific alloc and free function prototypes from stdlib.h
  9. Bugzilla 22454: OpenBSD: Add prototypes for pthread_np.h
  10. Bugzilla 22457: OpenBSD: enableDwarf in opApply in runtime.d
  11. Bugzilla 22542: Explicitly cast backtrace results to int
  12. Bugzilla 22545: OpenBSD: Always use system backtrace
  13. Bugzilla 22669: OpenBSD: Sync socket.d
  14. Bugzilla 22670: Support *BSD kqueue-backed API-compatible inotify shim library

dlang.org bug fixes

  1. Bugzilla 19136: is expressions don't work as documented
  2. Bugzilla 21717: [Oh No! Page Not Found]
  3. Bugzilla 22064: Missing documentation page for phobos core.builtins
  4. Bugzilla 22281: unreadable quotes in the upcoming 2.099 changelog
  5. Bugzilla 22363: Wrong link in https://dlang.org/spec/abi.html for "Garbage Collection"
  6. Bugzilla 22417: Slice assignment operator overloading example is incorrect
  7. Bugzilla 22504: spec/type.html: 6.1 Basic Data Types: Backslash missing in default value for {,d,w}char
  8. Bugzilla 22518: [dip1000] return without scope/ref not specified
  9. Bugzilla 22544: [spec] C++ and Objective-C are not single tokens
  10. Bugzilla 22692: Underground Rekordz link is dead
  11. Bugzilla 22711: Effect of template UDAs on instance members is undocumented

dlang.org enhancements

  1. Bugzilla 22425: Documentation on implicit conversion of arrays is incomplete
  2. Bugzilla 22431: Add OpenBSD to Third-party downloads list

Installer enhancements

  1. Bugzilla 18362: Build dmd with LTO and PGO
  2. 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.

previous version: 2.098.0