From patchwork Thu Jun 25 15:41:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1317017 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=gcc.gnu.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=xs07aGyE; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49t44P6mzVz9sRf for ; Fri, 26 Jun 2020 01:41:25 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9375D383F86B; Thu, 25 Jun 2020 15:41:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9375D383F86B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593099683; bh=GCglPFQOXb/z73rHVsujtdTPdZrK5eawUG2Rkplu9u4=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=xs07aGyEaD1ohpSeWosOFgvcmGy4KcbIpcklcH3xBkulHu5wSr1VNgagO9LMCTxYs Y4uho5A+K+Kvp1F1SlcnAEj6107FMW3roCGeLX6NuH8N/zAvEDK/pVWM8zl3SGrMld aUsZIzqwFqw8vH5zQNbfZ0Cgiz+PUjUv/0CO5DKI= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mout-p-202.mailbox.org (mout-p-202.mailbox.org [IPv6:2001:67c:2050::465:202]) by sourceware.org (Postfix) with ESMTPS id AB58A3840C37 for ; Thu, 25 Jun 2020 15:41:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org AB58A3840C37 Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 49t44J6ckwzQlK7; Thu, 25 Jun 2020 17:41:20 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter04.heinlein-hosting.de (spamfilter04.heinlein-hosting.de [80.241.56.122]) (amavisd-new, port 10030) with ESMTP id jo6UGJj0I9NF; Thu, 25 Jun 2020 17:41:17 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed] d: Merge upstream dmd 90450f3ef. Date: Thu, 25 Jun 2020 17:41:02 +0200 Message-Id: <20200625154102.2308106-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-MBO-SPAM-Probability: 3 X-Rspamd-Score: 0.49 / 15.00 / 15.00 X-Rspamd-Queue-Id: 5AD171784 X-Rspamd-UID: 2f24af X-Spam-Status: No, score=-16.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Iain Buclaw via Gcc-patches From: Iain Buclaw Reply-To: Iain Buclaw Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" 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 }