diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2021-06-11 19:33:07 +0200 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2021-06-11 19:42:13 +0200 |
commit | 68f46862d33707450bdf70cfddd91ae2a12527a8 (patch) | |
tree | e00210213fae352339fe0a8e8ef328d84f9131e1 /libphobos | |
parent | b13f297f01c943aa167f7c6eb94bed40dce0d553 (diff) | |
download | gcc-68f46862d33707450bdf70cfddd91ae2a12527a8.zip gcc-68f46862d33707450bdf70cfddd91ae2a12527a8.tar.gz gcc-68f46862d33707450bdf70cfddd91ae2a12527a8.tar.bz2 |
d: foreach over a tuple doesn't work on 16-bit targets (PR100999)
Improves semantic passes in the front-end around the `foreach' and
`static foreach' statements to be more resilient to compiling in a
minimal D runtime environment. Checking of the index type has been
improved as well so now there won't be needless compiler errors when
using 8 or 16-bit integers as index types when the size fits the
expected loop range.
gcc/d/ChangeLog:
PR d/100999
* dmd/MERGE: Merge upstream dmd 7a3808254.
libphobos/ChangeLog:
PR d/100999
* src/MERGE: Merge upstream phobos 55bb17543.
Diffstat (limited to 'libphobos')
-rw-r--r-- | libphobos/src/MERGE | 2 | ||||
-rw-r--r-- | libphobos/src/std/typecons.d | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/libphobos/src/MERGE b/libphobos/src/MERGE index ac709f9..01cf594 100644 --- a/libphobos/src/MERGE +++ b/libphobos/src/MERGE @@ -1,4 +1,4 @@ -63f4caa900e17c541042617b2fa187059b86bf88 +55bb17543138a87c376a84745f2a30ec00bdecd9 The first line of this file holds the git revision number of the last merge done from the dlang/phobos repository. diff --git a/libphobos/src/std/typecons.d b/libphobos/src/std/typecons.d index 55119fc..84e876f 100644 --- a/libphobos/src/std/typecons.d +++ b/libphobos/src/std/typecons.d @@ -5935,13 +5935,7 @@ mixin template Proxy(alias a) // built-in type field, manifest constant, and static non-mutable field enum opDispatch = mixin("a."~name); } - else static if (is(typeof(mixin("a."~name))) || __traits(getOverloads, a, name).length != 0) - { - // field or property function - @property auto ref opDispatch(this X)() { return mixin("a."~name); } - @property auto ref opDispatch(this X, V)(auto ref V v) { return mixin("a."~name~" = v"); } - } - else + else static if (__traits(isTemplate, mixin("a."~name))) { // member template template opDispatch(T...) @@ -5950,6 +5944,13 @@ mixin template Proxy(alias a) auto ref opDispatch(this X, Args...)(auto ref Args args){ return mixin("a."~name~targs~"(args)"); } } } + else + { + // field or property function + @property auto ref opDispatch(this X)() { return mixin("a."~name); } + @property auto ref opDispatch(this X, V)(auto ref V v) { return mixin("a."~name~" = v"); } + } + } import std.traits : isArray; |