Skip to content

Commit

Permalink
Upgrade to D v2.080.1 (#2737)
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed Jun 8, 2018
1 parent 5a7cc89 commit 7611e75
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ set(LDC_VERSION "1.10.0") # May be overridden by git hash tag
set(DMDFE_MAJOR_VERSION 2)
set(DMDFE_MINOR_VERSION 0)
set(DMDFE_PATCH_VERSION 80)
set(DMDFE_FIX_LEVEL 0) # Comment out if not used
set(DMDFE_FIX_LEVEL 1) # Comment out if not used

set(DMD_VERSION ${DMDFE_MAJOR_VERSION}.${DMDFE_MINOR_VERSION}${DMDFE_PATCH_VERSION})
if(DEFINED DMDFE_FIX_LEVEL)
Expand Down
6 changes: 5 additions & 1 deletion dmd/clone.d
Original file line number Diff line number Diff line change
Expand Up @@ -765,7 +765,11 @@ extern (C++) FuncDeclaration buildXtoHash(StructDeclaration sd, Scope* sc)
const(char)* code =
"size_t h = 0;" ~
"foreach (i, T; typeof(p.tupleof))" ~
" h = h * 33 + typeid(T).getHash(cast(const void*)&p.tupleof[i]);" ~
// workaround https://issues.dlang.org/show_bug.cgi?id=17968
" static if(is(T* : const(Object)*)) " ~
" h = h * 33 + typeid(const(Object)).getHash(cast(const void*)&p.tupleof[i]);" ~
" else " ~
" h = h * 33 + typeid(T).getHash(cast(const void*)&p.tupleof[i]);" ~
"return h;";
fop.fbody = new CompileStatement(loc, new StringExp(loc, cast(char*)code));
Scope* sc2 = sc.push();
Expand Down
2 changes: 1 addition & 1 deletion dmd/dstruct.d
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ extern (C++) class StructDeclaration : AggregateDeclaration
{
if ((stype.alignment() < Target.ptrsize ||
(v.offset & (Target.ptrsize - 1))) &&
sc.func.setUnsafe())
(sc.func && sc.func.setUnsafe()))
{
.error(loc, "field `%s.%s` cannot assign to misaligned pointers in `@safe` code",
toChars(), v.toChars());
Expand Down
3 changes: 2 additions & 1 deletion dmd/initsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

module dmd.initsem;

import core.stdc.stdio;
import core.checkedint;

import dmd.aggregate;
Expand Down Expand Up @@ -192,7 +193,7 @@ private extern(C++) final class InitializerSemanticVisitor : Visitor
{
if ((t.alignment() < Target.ptrsize ||
(vd.offset & (Target.ptrsize - 1))) &&
sc.func.setUnsafe())
sc.func && sc.func.setUnsafe())
{
error(i.loc, "field `%s.%s` cannot assign to misaligned pointers in `@safe` code",
sd.toChars(), vd.toChars());
Expand Down
5 changes: 5 additions & 0 deletions dmd/mars.d
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,11 @@ extern (C++) int mars_mainBody(ref Strings files, ref Strings libmodules)
Library library = null;
if (global.params.lib)
{
if (global.params.objfiles.dim == 0)
{
error(Loc.initial, "no input files");
return EXIT_FAILURE;
}
library = Library.factory();
library.setFilename(global.params.objdir, global.params.libname);
// Add input object and input library files to output library
Expand Down

0 comments on commit 7611e75

Please sign in to comment.