Change Log: 2.075.0 (upcoming)
Download D nightlies
To be released
Compiler changes
Library changes
- Added std.algorithm.searching.minIndex to get the index of the minimum element of a range.
- Added std.meta.staticIsSorted to check if an AliasSeq is sorted according to some template predicate.
- Added std.algorithm.searching.maxIndex to get the index of the maximum element of a range.
- Added std.traits.Promoted to get the result of scalar type promotion in multi-term arithmetic expressions
- std.traits.hasFunctionAttributes has been added
- std.experimental.ndslice has been deprecated.
List of all upcoming bug fixes and enhancements.
Compiler changes
- The builtin Ddoc theme has been overhauled.
Dmd will now use more modern looking theme for generated documentation, also see dmd#6173.
- New command line option -mscrtlib=libname for Windows MS-COFF object files.
If building MS-COFF object files with -m64 or -m32mscoff, this option specifies the reference to the C runtime library libname that is embedded into the object file containing main, DllMain or WinMain for automatic linking. The default is libcmt (release version with static linkage), the other usual alternatives are libcmtd, msvcrt and msvcrtd. If libname is empty, no C runtime library is automatically linked in.
Library changes
- Added std.algorithm.searching.minIndex to get the index of the minimum element of a range.
std.algorithm.searching.minIndex gets the index of the minimum element of a range, according to a specified predicate. The default predicate is "a < b".
import std.algorithm.searching : minIndex; int[] a = [5, 4, 2, 1, 9, 10]; assert(a.minIndex == 3); int[] a; assert(a.minIndex == -1);
- Added std.meta.staticIsSorted to check if an AliasSeq is sorted according to some template predicate.
std.meta.staticIsSorted checks whether an AliasSeq is sorted according to some template predicate.
enum Comp(T1, T2) = T1.sizeof < T2.sizeof; import std.meta : staticIsSorted; static assert( staticIsSorted!(Comp, byte, uint, double)); static assert(!staticIsSorted!(Comp, bool, long, dchar));
Additionally, the compile-time performance of std.meta.staticSort has been greatly improved. Nevertheless, due to compiler limitations it is still an extraordinarily expensive operation to perform on longer sequences; strive to minimize such use.
- Added std.algorithm.searching.maxIndex to get the index of the maximum element of a range.
std.algorithm.searching.maxIndex gets the index of the maximum element of a range, according to a specified predicate. The default predicate is "a > b".
import std.algorithm.searching : maxIndex; int[] a = [5, 4, 2, 1, 9, 10]; assert(a.minIndex == 5); int[] a; assert(a.minIndex == -1);
- Added std.traits.Promoted to get the result of scalar type promotion in multi-term arithmetic expressions
std.traits.Promoted gets the type to which a scalar type will be promoted in multi-term arithmetic expressions
import std.traits : Promoted; static assert(is(typeof(ubyte(3) * ubyte(5)) == Promoted!ubyte)); static assert(is(Promoted!ubyte == int));
See the D specification on scalar type promotions for more information.
- std.traits.hasFunctionAttributes has been added
It exposes a user-friendly way to query for function attributes:
import std.traits : hasFunctionAttributes; // manually annotated function real func(real x) pure nothrow @safe { return x; } static assert(hasFunctionAttributes!(func, "@safe", "pure")); static assert(!hasFunctionAttributes!(func, "@trusted")); // for templated function types are automatically inferred bool myFunc(T)(T b) { return !b; } static assert(hasFunctionAttributes!(myFunc!bool, "@safe", "pure", "@nogc", "nothrow")); static assert(!hasFunctionAttributes!(myFunc!bool, "shared"));
- std.experimental.ndslice has been deprecated.
The synchronization between Phobos and Mir turned out to be a lot of work with litte gain. Users of std.experimental.ndslice are advised to switch to the upstream mir package.
List of all bug fixes and enhancements in D 2.075.0 (upcoming):
DMD Compiler regressions
- Bugzilla 16408: [REG2.065] left-to-right order of evaluation of function arguments not consistently followed
- Bugzilla 17275: [REG 2.072.0] [email protected](2121): Assertion failure
- Bugzilla 17293: "Using C++ Classes From D" example no longer works
- Bugzilla 17338: [Reg 2.075] link failure unsupported symbol section 0xff01
- Bugzilla 17356: [Reg 2.075] __simd_sto no longer executed
- Bugzilla 17399: [REG2.071] core.checkedint.addu cannot inline function
- Bugzilla 17407: [REG2.067] __traits(compiles) triggers assertion failure
- Bugzilla 17451: ICE in ddmd/declaration.d(2179)
- Bugzilla 17505: [REG2.075] @safe constructor requires the deconstructor to be safe as well
- Bugzilla 17506: [REG2.075] @disable constructor requires members to be initialized
- Bugzilla 17522: win64.mak broken
- Bugzilla 17582: [REG2.059] Applying const to struct declaration should make the struct type const
DMD Compiler bugs
- Bugzilla 4014: CodeView debug type info not linked in from library
- Bugzilla 7016: local import does not create -deps dependency
- Bugzilla 11881: -betterC switch suffers from bit rot
- Bugzilla 13331: naked asm functions are broken when compiling with -profile
- Bugzilla 13512: Allow non-UTF-8 encoding in shebang line
- Bugzilla 14246: RAII - proper destruction of partially constructed objects/structs
- Bugzilla 15896: private ignored when import bindings are used
- Bugzilla 15945: sizeof on an invalid type seems to compile.
- Bugzilla 16244: compiler ICE on complex typeof() for method arg type
- Bugzilla 16566: hasLength should enforce that length has type size_t
- Bugzilla 16640: void fun(string file=__FILE_FULL_PATH__) returns relative path
- Bugzilla 17289: With Xcode 8.3 linker, warnings of "pointer not aligned"
- Bugzilla 17335: Function calls in conjunctions do not short circuit when evaluated during compilation
- Bugzilla 17337: SIGILL for AVX vector initialization
- Bugzilla 17339: ambiguous mangling with const alias argument
- Bugzilla 17344: ICE with assignment of post inc-/decremented integral vector
- Bugzilla 17349: Covariant overrides should be allowed
- Bugzilla 17367: CodeView/MSCOFF: bad debug information for enumerators
- Bugzilla 17391: SECURITY: XSSÂ through DDOC comments
- Bugzilla 17422: [scope] class reference not initialized as scope variable
- Bugzilla 17432: [DIP1000] scope delegates change type, but not mangling
- Bugzilla 17450: escaping delegate context pointer not detected for member functions
- Bugzilla 17468: Internal assertion fails during CTFE
- Bugzilla 17489: ICE in ddmd/argtypes.d
- Bugzilla 17491: Compiles on invalid: *&s.init.var is not an lvalue
- Bugzilla 17495: __traits(getParameterStorageClasses) doesn't work with tuples as parameters
- Bugzilla 17551: VC build: bad mangling of real template argument
DMD Compiler enhancements
- Bugzilla 6227: Comparison of different enums
- Bugzilla 16197: Constructors/postblits and destructors don't match up for array initialisation
- Bugzilla 16540: Attributes do not propagate correctly in lazy params
- Bugzilla 16600: Wrong error message for ambiguous mutable/immutable constructor
- Bugzilla 17396: Add colorized syntax highlighting to error messages emitted by dmd
- Bugzilla 17419: add __traits(getLinkage, s) to the the linkage of symbol s
- Bugzilla 17425: add __traits(getParameterStorageClasses, f, i)
- Bugzilla 17429: [scope] each scope class references adds another delete call
- Bugzilla 17457: Named Return Value Optimization (NRVO) not done with return of constructor call
- Bugzilla 17494: Do not execute scope(...) if an Error exception has been thrown
- Bugzilla 17499: with -betterC switch, call C's assert failure function rather than druntime's
- Bugzilla 17521: -betterC programs should not link in Phobos runtime library by default
Phobos regressions
- Bugzilla 17264: [REG2.073] uniq fails with const elements
- Bugzilla 17330: [REG 2.072] BigInt's constructor used to be pure
- Bugzilla 17340: [REG 2.074.0] isNumeric!bool should not be true
- Bugzilla 17452: Undefined references in std.container.array
- Bugzilla 17472: [Reg 2.075] typeof(stdin) is no longer a File
Phobos bugs
- Bugzilla 12866: Append to std.container.Array of fixed size arrays
- Bugzilla 15517: std.experimental.logger: using 'sharedLog' to change to file logging for default logger does not work
- Bugzilla 15534: [std.experimental.logger.core] Documentation mismatch
- Bugzilla 15720: iota(long.max, long.min, step) does not work properly
- Bugzilla 15763: std.math.approxEqual is not symmetric
- Bugzilla 16232: std.experimental.logger.core.sharedLog isn't thread-safe
- Bugzilla 16246: cannot call iota with 3 [u]bytes or 3 [u]shorts
- Bugzilla 16256: std.experimental.logger cant log a dstring properly
- Bugzilla 16326: filter is not lazy enough & has weird save behavior
- Bugzilla 17251: Appender.put errors out with const input range elements
- Bugzilla 17270: std.experimental.Final fails on pointers
- Bugzilla 17283: std.experimental.typecons uses private module members
- Bugzilla 17288: formattedWrite error when width/precision provided and no value to format
- Bugzilla 17314: BinaryHeap crashes upon insertion if heapified with an array of length 1
- Bugzilla 17328: std.experimental.logger: wrong hex formatting for zeros
- Bugzilla 17389: std.traits.hasNested fails for class with member of same type
- Bugzilla 17519: RedBlackTree doesn't like const/immutable elements
- Bugzilla 17562: Tangent function returns NaN for abs(input) >= 2^63
- Bugzilla 17574: Range violation in std.getopt:getopt AA parsing
Phobos enhancements
- Bugzilla 6621: Superimposition amount for std.range.chunks
- Bugzilla 7102: std.numeric.gcd with BigInts too
- Bugzilla 10001: string formatting with underscores
- Bugzilla 16108: to!string fails on struct with disabled postblit
- Bugzilla 16615: std.process is missing functionality for child processes
- Bugzilla 17286: A function for comparing two digests securely
- Bugzilla 17327: std.getopt: repeated options unrecognised
- Bugzilla 17394: std.file.mkdirRecurse isn't @safe
Druntime bugs
- Bugzilla 9275: [GC] removeRoot hits assert(0) instead of being a no-op (as documented)
- Bugzilla 12233: Attempting to use TypeInfo.init results in a compiler error due to lack of 'this'.
- Bugzilla 13186: core/sys/posix/sys/uio.d is not linked into the standard lib
dlang.org bugs
- Bugzilla 8107: Float literals are not specified as they are implemented
- Bugzilla 17224: Foreach documentation still refers to TypeTuples, rather than AliasSequences
- Bugzilla 17303: type error in the href url under the link Systems Programming
- Bugzilla 17305: [SPEC] ABI page still has references to D1 Phobos
- Bugzilla 17469: View source code
- Bugzilla 17501: Runnable unittest problem with AST rewrite
- Bugzilla 17509: [typo] "refered to" ("referred to")
- Bugzilla 17510: How could 509 be a byte value?
- Bugzilla 17513: [english] "a enum" -> "an enum"
dlang.org enhancements
- Bugzilla 17262: Better docs for rdmd
- Bugzilla 17322: Add Magikcraft to organizations using D
- Bugzilla 17524: [The C Preprocessor vs D] "need to worry about"?
- Bugzilla 17560: Enhancement: view and copy full code example for offline compile/play