aboutsummaryrefslogtreecommitdiff
path: root/gcc/d
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gcc.gnu.org>2019-03-10 21:55:30 +0000
committerIain Buclaw <ibuclaw@gcc.gnu.org>2019-03-10 21:55:30 +0000
commit5f49d2fc4e52398f04a39f81069bb5d1c21bb168 (patch)
treeeec381467d65575a54b03cacbdba6c61a8fbc314 /gcc/d
parent42a84c28ef2fec57faa061e0676437e354c8c521 (diff)
downloadgcc-5f49d2fc4e52398f04a39f81069bb5d1c21bb168.zip
gcc-5f49d2fc4e52398f04a39f81069bb5d1c21bb168.tar.gz
gcc-5f49d2fc4e52398f04a39f81069bb5d1c21bb168.tar.bz2
re PR d/87824 (x86_64-linux multilib issues)
PR d/87824 d/dmd: Merge upstream dmd fcc235e8e Associative arrays are value types, which are not covariant with the pointer type typeof(null). Updates https://gcc.gnu.org/PR87824 Reviewed-on: https://github.com/dlang/dmd/pull/9435 From-SVN: r269561
Diffstat (limited to 'gcc/d')
-rw-r--r--gcc/d/dmd/MERGE2
-rw-r--r--gcc/d/dmd/mtype.c13
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE
index 313748f..cf5a22f 100644
--- a/gcc/d/dmd/MERGE
+++ b/gcc/d/dmd/MERGE
@@ -1,4 +1,4 @@
-da26db81943952c7e35dab98650df589ec122485
+fcc235e8e25f7758266f7874edd5abefb9943e0b
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
diff --git a/gcc/d/dmd/mtype.c b/gcc/d/dmd/mtype.c
index 2a23cab..900f172 100644
--- a/gcc/d/dmd/mtype.c
+++ b/gcc/d/dmd/mtype.c
@@ -5331,9 +5331,16 @@ int Type::covariant(Type *t, StorageClass *pstc, bool fix17349)
}
else if (t1n->ty == t2n->ty && t1n->implicitConvTo(t2n))
goto Lcovariant;
- else if (t1n->ty == Tnull && t1n->implicitConvTo(t2n) &&
- t1n->size() == t2n->size())
- goto Lcovariant;
+ else if (t1n->ty == Tnull)
+ {
+ // NULL is covariant with any pointer type, but not with any
+ // dynamic arrays, associative arrays or delegates.
+ // https://issues.dlang.org/show_bug.cgi?id=8589
+ // https://issues.dlang.org/show_bug.cgi?id=19618
+ Type *t2bn = t2n->toBasetype();
+ if (t2bn->ty == Tnull || t2bn->ty == Tpointer || t2bn->ty == Tclass)
+ goto Lcovariant;
+ }
}
goto Lnotcovariant;