- Throwing from contracts of `nothrow' functions has been
deprecated, as this breaks the guarantees of `nothrow'.
- Added language support for initializing the interior pointer of
associative arrays using `new' keyword.
Phobos changes:
- The std.digest.digest module has been removed.
- The std.xml module has been removed.
gcc/d/ChangeLog:
* dmd/MERGE: Merge upstream dmd d579c467c1.
* decl.cc (layout_struct_initializer): Update for new front-end
interface.
* expr.cc (ExprVisitor::visit (AssignExp *)): Remove lowering of array
assignments.
(ExprVisitor::visit (NewExp *)): Add new lowering of new'ing
associative arrays to an _aaNew() library call.
* runtime.def (ARRAYSETASSIGN): Remove.
(AANEW): Define.
@@ -3758,9+3759,9 @@ extern (C++) final class FuncLiteralDeclaration : FuncDeclaration
// backend
bool deferToObj;
- extern (D) this(const ref Loc loc, const ref Loc endloc, Type type, TOK tok, ForeachStatement fes, Identifier id = null)
+ extern (D) this(const ref Loc loc, const ref Loc endloc, Type type, TOK tok, ForeachStatement fes, Identifier id = null, StorageClass storage_class = STC.undefined_)
{
- super(loc, endloc, null, STC.undefined_, type);
+ super(loc, endloc, null, storage_class, type);
this.ident = id ? id : Id.empty;
this.tok = tok;
this.fes = fes;
@@ -3774,7+3775,7 @@ extern (C++) final class FuncLiteralDeclaration : FuncDeclaration
fail_compilation/imports/fail17646.d(10): Error: found `}` instead of statement
-fail_compilation/imports/fail17646.d(7): Error: function `imports.fail17646.allTestData!"".allTestData` has no `return` statement, but is expected to return a value of type `const(TestData)[]`
-fail_compilation/fail17646.d(19): instantiated from here: `runTests!""`
+fail_compilation/fail17646.d(11): Error: function `fail17646.runTests!"".runTests` has no `return` statement, but is expected to return a value of type `int`
-(spec:1) fail_compilation/test17380spec.d(14): Error: no property `ThisTypeDoesNotExistAndCrashesTheCompiler` for type `test17380spec.Uint128`
+(spec:1) fail_compilation/test17380spec.d(14): Error: no property `ThisTypeDoesNotExistAndCrashesTheCompiler` for `this.opCast()` of type `test17380spec.Uint128`
@@ -29,8+29,7 @@ the store and the limits. One allocation entails rounding up the allocation
size for alignment purposes, bumping the current pointer, and comparing it
against the limit.
-If `ParentAllocator` is different from $(REF_ALTTEXT `NullAllocator`, NullAllocator, std,experimental,allocator,building_blocks,null_allocator), `Region`
-deallocates the chunk of memory during destruction.
+`Region` deallocates the chunk of memory during destruction.
The `minAlign` parameter establishes alignment. If $(D minAlign > 1), the
sizes of all allocation requests are rounded up to a multiple of `minAlign`.
@@ -38,7+37,7 @@ Applications aiming at maximum speed may want to choose $(D minAlign = 1) and
Constructs a region backed by a user-provided store.
- Assumes the memory was allocated with `ParentAllocator`
- (if different from $(REF_ALTTEXT `NullAllocator`, NullAllocator, std,experimental,allocator,building_blocks,null_allocator)).
+ Assumes the memory was allocated with `ParentAllocator`.
Params:
- store = User-provided store backing up the region. If $(D
- ParentAllocator) is different from $(REF_ALTTEXT `NullAllocator`, NullAllocator, std,experimental,allocator,building_blocks,null_allocator), memory is assumed to
- have been allocated with `ParentAllocator`.
- n = Bytes to allocate using `ParentAllocator`. This constructor is only
- defined If `ParentAllocator` is different from $(REF_ALTTEXT `NullAllocator`, NullAllocator, std,experimental,allocator,building_blocks,null_allocator). If
- `parent.allocate(n)` returns `null`, the region will be initialized
- as empty (correctly initialized but unable to allocate).
+ store = User-provided store backing up the region. Assumed to have been
+ allocated with `ParentAllocator`.
+ n = Bytes to allocate using `ParentAllocator`. If `parent.allocate(n)`
+ returns `null`, the region will be initialized as empty (correctly
+ initialized but unable to allocate).
*/
this(ubyte[] store) pure nothrow @nogc
{
- _begin = store.ptr;
- _end = store.ptr + store.length;
- static if (growDownwards)
- _current = roundedEnd();
- else
- _current = roundedBegin();
+ _impl = store;
}
/// Ditto
- static if (!is(ParentAllocator == NullAllocator) && !stateSize!ParentAllocator)
- If `ParentAllocator` is not $(REF_ALTTEXT `NullAllocator`, NullAllocator, std,experimental,allocator,building_blocks,null_allocator) and defines `deallocate`,
- the region defines a destructor that uses `ParentAllocator.deallocate` to free the
- memory chunk.
+ If `ParentAllocator` defines `deallocate`, the region defines a destructor
+ that uses `ParentAllocator.deallocate` to free the memory chunk.
*/
- static if (!is(ParentAllocator == NullAllocator)
- && hasMember!(ParentAllocator, "deallocate"))
+ static if (hasMember!(ParentAllocator, "deallocate"))
~this()
{
- parent.deallocate(_begin[0 .. _end - _begin]);
+ with (_impl) parent.deallocate(_begin[0 .. _end - _begin]);
Constructs a region backed by a user-provided store.
- Assumes the memory was allocated with `ParentAllocator`
- (if different from $(REF_ALTTEXT `NullAllocator`, NullAllocator, std,experimental,allocator,building_blocks,null_allocator)).
+ Assumes the memory was allocated with `ParentAllocator`.
Params:
- store = User-provided store backing up the region. If `ParentAllocator`
- is different from $(REF_ALTTEXT `NullAllocator`, NullAllocator, std,experimental,allocator,building_blocks,null_allocator), memory is assumed to
- have been allocated with `ParentAllocator`.
- n = Bytes to allocate using `ParentAllocator`. This constructor is only
- defined If `ParentAllocator` is different from $(REF_ALTTEXT `NullAllocator`, NullAllocator, std,experimental,allocator,building_blocks,null_allocator). If
- `parent.allocate(n)` returns `null`, the region will be initialized
- as empty (correctly initialized but unable to allocate).
+ store = User-provided store backing up the region. Assumed to have been
+ allocated with `ParentAllocator`.
+ n = Bytes to allocate using `ParentAllocator`. If `parent.allocate(n)`
+ returns `null`, the region will be initialized as empty (correctly
- If `ParentAllocator` is not $(REF_ALTTEXT `NullAllocator`, NullAllocator, std,experimental,allocator,building_blocks,null_allocator) and defines `deallocate`,
- the region defines a destructor that uses `ParentAllocator.deallocate` to free the
- memory chunk.
+ If `ParentAllocator` defines `deallocate`, the region defines a destructor
+ that uses `ParentAllocator.deallocate` to free the memory chunk.
*/
- static if (!is(ParentAllocator == NullAllocator)
- && hasMember!(ParentAllocator, "deallocate"))
+ static if (hasMember!(ParentAllocator, "deallocate"))