diff --git a/VERSION b/VERSION index 320e1686b2ba..97086204559f 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -2.075.0 +v2.074.1 diff --git a/src/ddmd/ctfeexpr.d b/src/ddmd/ctfeexpr.d index 1924c7e1680f..d67e3bf3ce9e 100644 --- a/src/ddmd/ctfeexpr.d +++ b/src/ddmd/ctfeexpr.d @@ -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; @@ -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); diff --git a/src/ddmd/globals.d b/src/ddmd/globals.d index a7a143632f61..a60fd22fc21c 100644 --- a/src/ddmd/globals.d +++ b/src/ddmd/globals.d @@ -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"; diff --git a/src/posix.mak b/src/posix.mak index 803db4df0ef8..bc300f3daddc 100644 --- a/src/posix.mak +++ b/src/posix.mak @@ -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 ) diff --git a/test/compilable/test17468.d b/test/compilable/test17468.d new file mode 100644 index 000000000000..840de219ae97 --- /dev/null +++ b/test/compilable/test17468.d @@ -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); +