From patchwork Thu Jun 25 15:41:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Iain Buclaw X-Patchwork-Id: 1317021 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=tczhrPFR; 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 49t44k6vMBz9sRf for ; Fri, 26 Jun 2020 01:41:42 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EAD35388A834; Thu, 25 Jun 2020 15:41:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EAD35388A834 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1593099698; bh=ewSGtM2K0bKGda6UkcqoWbma2ZDM0qprl9VmicwZpB0=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=tczhrPFR4MCnbxdAAikTTzxNX6b7kmOfH+8QIVxJaHrFZyOcaPFjksQKqp86w1lqp KUFiMwC5NPHgqcuVPV1fxrAmbTytMbvpuEmmymy0sWhY6L/4V5JMt0053gCGrTy3fr UnLynq8DirSEXlZe0leLJj2xAFxml/MPk2YUx+Bs= 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 [80.241.56.172]) by sourceware.org (Postfix) with ESMTPS id 3EF99388A833 for ; Thu, 25 Jun 2020 15:41:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 3EF99388A833 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:105:465:1:1:0]) (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 49t44Y2FQnzQlK7; Thu, 25 Jun 2020 17:41:33 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id lyl67ay8KzqS; Thu, 25 Jun 2020 17:41:29 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [committed] d: Turn on deprecation warnings by default. Date: Thu, 25 Jun 2020 17:41:26 +0200 Message-Id: <20200625154126.2308272-1-ibuclaw@gdcproject.org> MIME-Version: 1.0 X-MBO-SPAM-Probability: 0 X-Rspamd-Score: -0.25 / 15.00 / 15.00 X-Rspamd-Queue-Id: E4FB1175C X-Rspamd-UID: 359c7e X-Spam-Status: No, score=-16.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, 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 makes deprecation warnings the default in gdc, fixing both the library and any tests that are currently using deprecated styles. This is the default in the upstream reference compiler, and can reduce some confusion when comparing warning/error messages of gdc and dmd side by side. Merges libphobos with upstream druntime d05ebaad and phobos 021ae0df7. Bootstrapped and regression tested on x86_64-linux-gnu, and committed to mainline. Regards Iain. --- gcc/d/ChangeLog: * d-lang.cc (d_init_options): Turn on deprecation warnings by default. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime d05ebaad. * src/MERGE: Merge upstream phobos 021ae0df7. * testsuite/libphobos.typeinfo/struct-align.d: Remove empty statement. gcc/testsuite/ChangeLog: * gdc.dg/asm1.d: Don't use deprecated asm syntax. * gdc.dg/compilable.d: Add public to selective import. * gdc.dg/lto/ltotests_0.d: Explicitly catch Throwable. * gdc.dg/runnable.d: Remove empty statement. --- gcc/d/d-lang.cc | 2 +- gcc/testsuite/gdc.dg/asm1.d | 8 ++++---- gcc/testsuite/gdc.dg/compilable.d | 2 +- gcc/testsuite/gdc.dg/lto/ltotests_0.d | 2 +- gcc/testsuite/gdc.dg/runnable.d | 2 +- libphobos/libdruntime/MERGE | 2 +- libphobos/libdruntime/rt/util/utf.d | 4 ++-- libphobos/src/MERGE | 2 +- libphobos/src/std/range/package.d | 2 +- libphobos/testsuite/libphobos.typeinfo/struct-align.d | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/gcc/d/d-lang.cc b/gcc/d/d-lang.cc index 82e24de8cd1..24a1125ef8d 100644 --- a/gcc/d/d-lang.cc +++ b/gcc/d/d-lang.cc @@ -306,7 +306,7 @@ d_init_options (unsigned int, cl_decoded_option *decoded_options) global.params.cplusplus = CppStdRevisionCpp14; /* Warnings and deprecations are disabled by default. */ - global.params.useDeprecated = DIAGNOSTICoff; + global.params.useDeprecated = DIAGNOSTICinform; global.params.warnings = DIAGNOSTICoff; global.params.imppath = new Strings (); diff --git a/gcc/testsuite/gdc.dg/asm1.d b/gcc/testsuite/gdc.dg/asm1.d index 3fcfd6a58c1..dce36769370 100644 --- a/gcc/testsuite/gdc.dg/asm1.d +++ b/gcc/testsuite/gdc.dg/asm1.d @@ -13,8 +13,8 @@ void parse2() { asm { - "" : : "g" 1 ? 2 : 3; - "" : : "g" 1 ? 2 : : 3; + "" : : "g" (1 ? 2 : 3); + "" : : "g" (1 ? 2 : :) 3; // { dg-error "expression expected, not ':'" "" { target *-*-* } .-1 } // { dg-error "expected constant string constraint for operand" "" { target *-*-* } .-2 } } @@ -58,7 +58,7 @@ void semantic1() void semantic2a(X...)(X expr) { alias X[0] var1; - asm { "%0" : "=m" var1; } // { dg-error "double 'double' is a type, not an lvalue" } + asm { "%0" : "=m" (var1); } // { dg-error "double 'double' is a type, not an lvalue" } } void semantic2() @@ -86,6 +86,6 @@ void semantic4() { asm { - "%0" : : "m" S4.foo; // { dg-error "template instance opDispatch!\"foo\" has no value" } + "%0" : : "m" (S4.foo); // { dg-error "template instance opDispatch!\"foo\" has no value" } } } diff --git a/gcc/testsuite/gdc.dg/compilable.d b/gcc/testsuite/gdc.dg/compilable.d index 92a18756a0e..3f92f9b2957 100644 --- a/gcc/testsuite/gdc.dg/compilable.d +++ b/gcc/testsuite/gdc.dg/compilable.d @@ -250,7 +250,7 @@ class C204 : I204 // https://bugzilla.gdcproject.org/show_bug.cgi?id=241 import imports.gdc241a; -import imports.gdc241b : S241, C241, E241, N241; +public import imports.gdc241b : S241, C241, E241, N241; /******************************************/ // https://bugzilla.gdcproject.org/show_bug.cgi?id=242 diff --git a/gcc/testsuite/gdc.dg/lto/ltotests_0.d b/gcc/testsuite/gdc.dg/lto/ltotests_0.d index bb18beaa9c8..91737609f10 100644 --- a/gcc/testsuite/gdc.dg/lto/ltotests_0.d +++ b/gcc/testsuite/gdc.dg/lto/ltotests_0.d @@ -46,7 +46,7 @@ struct S61b { try other.a(); - catch + catch (Throwable) other.b(); } } diff --git a/gcc/testsuite/gdc.dg/runnable.d b/gcc/testsuite/gdc.dg/runnable.d index 7307e09a645..d974bda8c58 100644 --- a/gcc/testsuite/gdc.dg/runnable.d +++ b/gcc/testsuite/gdc.dg/runnable.d @@ -243,7 +243,7 @@ void test36b()(char val) auto test36c_1() { int a; - void c() {}; + void c() {} class Result { int b; diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE index 5e3bf3b795a..bcde10514ec 100644 --- a/libphobos/libdruntime/MERGE +++ b/libphobos/libdruntime/MERGE @@ -1,4 +1,4 @@ -5cc061a8733731d5b40334c0eb7a927b6d6241ce +d05ebaad15fbffce6d707c138c84d7b60fcf5ffd The first line of this file holds the git revision number of the last merge done from the dlang/druntime repository. diff --git a/libphobos/libdruntime/rt/util/utf.d b/libphobos/libdruntime/rt/util/utf.d index 07758409ec7..55869b37c8c 100644 --- a/libphobos/libdruntime/rt/util/utf.d +++ b/libphobos/libdruntime/rt/util/utf.d @@ -651,9 +651,9 @@ string toUTF8(in wchar[] s) else { r.length = i; - foreach (dchar c; s[i .. slen]) + foreach (dchar ch; s[i .. slen]) { - encode(r, c); + encode(r, ch); } break; } diff --git a/libphobos/src/MERGE b/libphobos/src/MERGE index 5900ca7c6a4..1562f747b74 100644 --- a/libphobos/src/MERGE +++ b/libphobos/src/MERGE @@ -1,4 +1,4 @@ -64ed4684fa2a0f2401f5b6df34f6dcb4c3973945 +021ae0df76727a32809a29887095ab7093489ea3 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/range/package.d b/libphobos/src/std/range/package.d index fe581f3853b..13601cb9da9 100644 --- a/libphobos/src/std/range/package.d +++ b/libphobos/src/std/range/package.d @@ -4874,7 +4874,7 @@ if (allSatisfy!(isInputRange, Ranges)) // Just make sure 1-range case instantiates. This hangs the compiler // when no explicit stopping policy is specified due to Bug 4652. auto stuff = lockstep([1,2,3,4,5], StoppingPolicy.shortest); - foreach (int i, a; stuff) + foreach (i, a; stuff) { assert(stuff[i] == a); } diff --git a/libphobos/testsuite/libphobos.typeinfo/struct-align.d b/libphobos/testsuite/libphobos.typeinfo/struct-align.d index 72866517481..54eaaa6ff5a 100644 --- a/libphobos/testsuite/libphobos.typeinfo/struct-align.d +++ b/libphobos/testsuite/libphobos.typeinfo/struct-align.d @@ -2,7 +2,7 @@ module structalign; void main () { - struct K { int *a; }; + struct K { int *a; } K k; auto ti = typeid (k);