Hi,

This patch merges the D front-end implementation with upstream dmd
90450f3ef.  Fixes a regression caused by an incomplete backport of
converting the Expression semantic pass to a Visitor.

Bootstrapped and regression tested on x86_64-linux-gnu, and committed to
mainline.

Regards
Iain.

---
gcc/d/ChangeLog:

        PR d/95250
        * dmd/MERGE: Merge upstream dmd 90450f3ef.

gcc/testsuite/ChangeLog:

        PR d/95250
        * gdc.dg/pr95250.d: New test.
---
 gcc/d/dmd/MERGE                |  2 +-
 gcc/d/dmd/expressionsem.c      |  1 +
 gcc/testsuite/gdc.dg/pr95250.d | 18 ++++++++++++++++++
 3 files changed, 20 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gdc.dg/pr95250.d

diff --git a/gcc/d/dmd/MERGE b/gcc/d/dmd/MERGE
index 0e48f42a0e2..0d50149a750 100644
--- a/gcc/d/dmd/MERGE
+++ b/gcc/d/dmd/MERGE
@@ -1,4 +1,4 @@
-5fc1806cd7dd281e944022df2e11ef6b04ee4339
+90450f3ef6ab8551b5f383d8c6190f80034dbf93
 
 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/expressionsem.c b/gcc/d/dmd/expressionsem.c
index e3a5cb36a82..ac6b5bc81f3 100644
--- a/gcc/d/dmd/expressionsem.c
+++ b/gcc/d/dmd/expressionsem.c
@@ -6883,6 +6883,7 @@ public:
         if (Expression *ex = binSemanticProp(exp, sc))
         {
             result = ex;
+            return;
         }
         Expression *e = exp->op_overload(sc);
         if (e)
diff --git a/gcc/testsuite/gdc.dg/pr95250.d b/gcc/testsuite/gdc.dg/pr95250.d
new file mode 100644
index 00000000000..c8810c41968
--- /dev/null
+++ b/gcc/testsuite/gdc.dg/pr95250.d
@@ -0,0 +1,18 @@
+// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95250
+// { dg-do compile }
+
+template Unsigned(T)
+{
+    static assert(false, "Type " ~ T.stringof ~
+                  " does not have an Unsigned counterpart");
+}
+
+
+void* f95250(T)(T a, T b)
+{
+        alias UnsignedVoid = Unsigned!(T);
+        return cast(T)(cast(T)(cast(UnsignedVoid)(a-b) / 2));
+}
+
+static assert(is(typeof(f!(void*)(null, null)) == void*));
+// { dg-error "static assert  \(.*\) is false" "" { target *-*-* } .-1 }
-- 
2.25.1

Reply via email to