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

previous version: 2.094.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.095.0 comes with 6 major changes and 22 fixed Bugzilla issues. A huge thanks goes to the 26 contributors who made 2.095.0 possible.

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

Compiler changes

  1. Template usage diagnostics via -vtemplates has been improved.

    Every template having at least one instantiation is now printed using standard compiler diagnostics formatting for easy navigation to the point of its declaration.

    All messages of this kind are sorted by descending unique instantiation count.

    If the flag argument list-instances is passed (such as -vtemplates=list-instances), each location where a template was instantiated is printed along with the reason for the instantiation (implicit or explicit).

    For instance, a D source file named main.d containing

    void foo(int I)() { }
    void goo1(int I)() { }
    void goo2(int I)() { goo1!(I); }
    
    void test()
    {
        foo!(1)();
        foo!(1)();
        foo!(2)();
    
        goo1!(1)();
    
        goo2!(1)();
    }
    

    compiled with -vtemplates=list-instances will output

    main.d(1): vtemplate: 3 (2 unique) instantiation(s) of template `foo(int I)()` found, they are:
    main.d(7): vtemplate: explicit instance `foo!1`
    main.d(8): vtemplate: explicit instance `foo!1`
    main.d(9): vtemplate: explicit instance `foo!2`
    main.d(2): vtemplate: 2 (1 unique) instantiation(s) of template `goo1(int I)()` found, they are:
    main.d(11): vtemplate: explicit instance `goo1!1`
    main.d(3): vtemplate: implicit instance `goo1!1`
    main.d(3): vtemplate: 1 (1 unique) instantiation(s) of template `goo2(int I)()` found, they are:
    main.d(13): vtemplate: explicit instance `goo2!1`
    
  2. Deprecate bypassing of symbol visibility when doing overload resolution

    If an aggregate declaration contains a private method and a public method in the same overload set it is possible to call the private method from a different module.

    Example:

    ==============================
    module foo;
    
    struct Foo
    {
      import std : writeln;
    
      private int _x;
    
      private ref int x() return
      {
        writeln("ref int");
        return _x;
      }
    
      int x() const
      {
        writeln("int");
        return _x;
      }
    }
    ============================
    
    ---
    

    module main;

    void main() { import std : writeln; import foo : Foo;

    auto f = Foo(); f.x = 3; // ok to call private method writeln(f); } ===========================

    Starting from this version a deprecation message will be issued in such situations.
  3. Improvements for the C++ header generation

    The following feautures/bugfixes/improvements were implemented for the experimental C++ header generator:

    • Enums are no longer emitted in macros and enum class is used if possible.
    • Forward referenced declarations are now properly indented.
    • Tuple members/parameters/variables are emitted as individual variables using the compiler internal names instaed of causing an assertion failure.
    • Interfaces are now emitted as base classes.

    Note: The header generator is still considerer experimental, so please submit any bugs encountered to the bug tracker.

  4. Diagnostics for conflicting function definitions within a module

    Previously, multiple definitions of identical functions within a module were not recognized, although they have the same mangling. This was problematic because a binary cannot contain multiple definitions of a symbol, which caused undefined behavior depending on the compiler backend.

    DMD will now raise an error message if there are conflicting implementations within a single module:

    void foo() {}
    void foo() {} // error
    

    Multiple declarations are still allowed as long as there is at most one definition:

    void bar(int);
    void bar(int) { }
    void bar(int);
    

    DMD will issue a deprecation for mangling schemes that don't support overloading (extern(C|Windows|System)):

    extern(C):
    void foo(int) { }
    void foo(double) { } // deprecation
    

    This deprecation will become an error in 2.105.

  5. C++ compability standard now c++11 by default

    The default setting for -extern-std= has been updated to c++11.

    Declarations with extern(C++) linkage are no longer guaranteed to link with code compiled by a C++98 compiler. Additionally, C++ headers generated by -HC will use constructs only available from C++11 onwards.

    If compatibility with older C++ compilers is required, you must now pass -extern-std=c++98 on the command-line.

Dub changes

  1. Caching of generated unittest runner (dub test)

    For projects without a user-defined unittest configuration dub test generates a main file automatically. This main file is now being cached and won't be regenerated won subsequent runs without file changes.


List of all bug fixes and enhancements in D 2.095.0:

DMD Compiler regressions

  1. Bugzilla 20608: [REG2.087] Cannot pass tuple.expand to auto ref T... template argument pack
  2. Bugzilla 21272: Overzealous and inconsistent foreach shadowing deprecations for nested functions

DMD Compiler bugs

  1. Bugzilla 3713: Tail call optimization not enabled with the ?: operator
  2. Bugzilla 10664: Win64: exception handling does not work with COMDAT folding
  3. Bugzilla 11049: array bounds error uses module file name rather than file name modified by #line directive
  4. Bugzilla 14708: destructor for temporary not called during stack unwinding
  5. Bugzilla 19754: cast() sometimes yields lvalue, sometimes yields rvalue
  6. Bugzilla 19970: [CTFE] 0 ptr is not null
  7. Bugzilla 20195: -preview=nosharedaccess has some access problems
  8. Bugzilla 21227: import(".\file") doesn't work on Windows
  9. Bugzilla 21246: Compiler must show mismatching types when functions do not properly override
  10. Bugzilla 21255: "overload alias ... forward declaration" when overload set of imported template functions is passed to alias template parameter

DMD Compiler enhancements

  1. Bugzilla 21204: Error in generated copy constructor gives confusing message
  2. Bugzilla 21259: struct initialization with deprecated fields should issue deprecation warnings
  3. Bugzilla 21275: Overload resolution bypasses private access

Phobos bugs

  1. Bugzilla 18801: std.stdio.File doesn't work with MSVCRT's UTF-8 mode
  2. Bugzilla 20924: std.numeric.gcd cannot be used with const BigInt
  3. Bugzilla 21249: clamp() is not stable and is not constrained

Phobos enhancements

  1. Bugzilla 20869: std.algorithm.mutation : move is overly trusting of opPostMove
  2. Bugzilla 21237: isLvalueAssignable and isRvalueAssignable should be public

Druntime enhancements

  1. Bugzilla 21030: Reduce template function instantiations related to array equality

dlang.org bugs

  1. Bugzilla 21273: [spec] Inexistent contrast for shell snippets make them unreadable (CSS)

Contributors to this release (26)

A huge thanks goes to all the awesome people who made this release possible.

previous version: 2.094.0