Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.075.0
v2.074.1
35 changes: 18 additions & 17 deletions src/ddmd/ctfeexpr.d
Original file line number Diff line number Diff line change
Expand Up @@ -398,23 +398,6 @@ extern (C++) UnionExp copyLiteral(Expression e)
r.type = e.type;
return ue;
}
if (isPointer(e.type))
{
// For pointers, we only do a shallow copy.
if (e.op == TOKaddress)
emplaceExp!(AddrExp)(&ue, e.loc, (cast(AddrExp)e).e1);
else if (e.op == TOKindex)
emplaceExp!(IndexExp)(&ue, e.loc, (cast(IndexExp)e).e1, (cast(IndexExp)e).e2);
else if (e.op == TOKdotvar)
{
emplaceExp!(DotVarExp)(&ue, e.loc, (cast(DotVarExp)e).e1, (cast(DotVarExp)e).var, (cast(DotVarExp)e).hasOverloads);
}
else
assert(0);
Expression r = ue.exp();
r.type = e.type;
return ue;
}
if (e.op == TOKslice)
{
SliceExp se = cast(SliceExp)e;
Expand Down Expand Up @@ -442,6 +425,24 @@ extern (C++) UnionExp copyLiteral(Expression e)
return ue;
}
}
if (isPointer(e.type))
{
// For pointers, we only do a shallow copy.
if (e.op == TOKaddress)
emplaceExp!(AddrExp)(&ue, e.loc, (cast(AddrExp)e).e1);
else if (e.op == TOKindex)
emplaceExp!(IndexExp)(&ue, e.loc, (cast(IndexExp)e).e1, (cast(IndexExp)e).e2);
else if (e.op == TOKdotvar)
{
emplaceExp!(DotVarExp)(&ue, e.loc, (cast(DotVarExp)e).e1, (cast(DotVarExp)e).var, (cast(DotVarExp)e).hasOverloads);
}
else
assert(0);

Expression r = ue.exp();
r.type = e.type;
return ue;
}
if (e.op == TOKclassreference)
{
emplaceExp!(ClassReferenceExp)(&ue, e.loc, (cast(ClassReferenceExp)e).value, e.type);
Expand Down
2 changes: 1 addition & 1 deletion src/ddmd/globals.d
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ struct Global
}
copyright = "Copyright (c) 1999-2017 by Digital Mars";
written = "written by Walter Bright";
_version = ('v' ~ import("VERSION") ~ '\0').ptr;
_version = (import("VERSION") ~ '\0').ptr;
compiler.vendor = "Digital Mars D";
stdmsg = stdout;
main_d = "__main.d";
Expand Down
27 changes: 11 additions & 16 deletions src/posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -466,25 +466,20 @@ $G/idgen: $D/idgen.d $(HOST_DMD_PATH)
CC=$(HOST_CXX) $(HOST_DMD_RUN) -of$@ $<
$G/idgen

#########
# STRING_IMPORT_FILES
#
# Create (or update) the generated VERSION file.
# The file is only updated if the VERSION file changes, or, only when RELEASE=1
# is not used, when the full version string changes (i.e. when the git hash or
# the working tree dirty states changes).
# The full version string have the form VERSION-devel-HASH(-dirty).
# The "-dirty" part is only present when the repository had uncommitted changes
# at the moment it was compiled (only files already tracked by git are taken
# into account, untracked files don't affect the dirty state).
VERSION := $(shell cat ../VERSION)
ifneq (1,$(RELEASE))
VERSION_GIT := $(shell printf "`$(GIT) rev-parse --short HEAD`"; \
test -n "`$(GIT) status --porcelain -uno`" && printf -- -dirty)
VERSION := $(addsuffix -devel$(if $(VERSION_GIT),-$(VERSION_GIT)),$(VERSION))
######## VERSION

VERSION := $(shell cat ../VERSION) # default to checked-in VERSION file
ifneq (1,$(RELEASE)) # unless building a release
VERSION_GIT := $(shell printf "`$(GIT) describe --dirty`") # use git describe
ifneq (,$(VERSION_GIT)) # check for git failures
VERSION := $(VERSION_GIT)
endif
endif

# only update $G/VERSION when it differs to avoid unnecessary rebuilds
$(shell test $(VERSION) != "`cat $G/VERSION 2> /dev/null`" \
&& printf $(VERSION) > $G/VERSION )

$(shell test $(SYSCONFDIR) != "`cat $G/SYSCONFDIR.imp 2> /dev/null`" \
&& printf '$(SYSCONFDIR)' > $G/SYSCONFDIR.imp )

Expand Down
12 changes: 12 additions & 0 deletions test/compilable/test17468.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// PERMUTE_ARGS:
struct S
{
const char* path;
@disable this();
this(const(char)* path)
{
this.path = path;
}
}
const S CONST_S = S("/tmp".ptr);