summaryrefslogtreecommitdiff
path: root/gcc/d/dmd/mtype.d
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/d/dmd/mtype.d')
-rw-r--r--gcc/d/dmd/mtype.d8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/d/dmd/mtype.d b/gcc/d/dmd/mtype.d
index 28978776e03..9297ad9dd03 100644
--- a/gcc/d/dmd/mtype.d
+++ b/gcc/d/dmd/mtype.d
@@ -648,7 +648,15 @@ extern (C++) abstract class Type : ASTNode
goto Lcovariant;
}
else if (t1n.ty == t2n.ty && t1n.implicitConvTo(t2n))
+ {
+ if (t1.isref && t2.isref)
+ {
+ // Treat like pointers to t1n and t2n
+ if (t1n.constConv(t2n) < MATCH.constant)
+ goto Lnotcovariant;
+ }
goto Lcovariant;
+ }
else if (t1n.ty == Tnull)
{
// NULL is covariant with any pointer type, but not with any