From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by sourceware.org (Postfix) with ESMTPS id E9712384859B for ; Tue, 24 May 2022 15:11:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E9712384859B Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4L6yMY3mW4z9sR2; Tue, 24 May 2022 17:11:21 +0200 (CEST) Date: Tue, 24 May 2022 17:11:17 +0200 From: Iain Buclaw Subject: Re: [PATCH 05/10] d: add 'final' and 'override' to gcc/d/*.cc 'visit' impls To: David Malcolm , gcc-patches@gcc.gnu.org References: <20220523192834.3785673-1-dmalcolm@redhat.com> <20220523192834.3785673-6-dmalcolm@redhat.com> <1653396934.mszzm5qg39.astroid@pulse.none> In-Reply-To: MIME-Version: 1.0 Message-Id: <1653404887.usgrvgr1qq.astroid@pulse.none> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4L6yMY3mW4z9sR2 X-Spam-Status: No, score=-5.7 required=5.0 tests=BAYES_00, BODY_8BITS, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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-List-Received-Date: Tue, 24 May 2022 15:11:26 -0000 Excerpts from David Malcolm's message of Mai 24, 2022 3:15 pm: > On Tue, 2022-05-24 at 14:56 +0200, Iain Buclaw wrote: >> Excerpts from David Malcolm via Gcc-patches's message of Mai 23, 2022 >> 9:28 pm: >> > gcc/d/ChangeLog: >> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* decl.cc: Add "final"= and "override" to all "visit" vfunc >> > decls >> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0as appropriate. >> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* expr.cc: Likewise. >> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* toir.cc: Likewise. >> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* typeinfo.cc: Likewis= e. >> > =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0* types.cc: Likewise. >> >=20 >> > Signed-off-by: David Malcolm >>=20 >>=20 >> Thanks David! >>=20 >> Looks OK to me. >>=20 >> Iain. >=20 > Thanks; I've pushed it to trunk as r13-736-g442cf0977a2993. >=20 > FWIW, to repeat something I said in the cover letter, I tried hacking - > Werror=3Dsuggest-override into the Makefile whilst I was creating the > patches, and IIRC there were a bunch of them in the gcc/d/dmd > subdirectory - but that code is copied from the D community upstream, > right? > So maybe if that D parser C++ code requires a C++11 compiler, perhaps > they might want to add "final" and "override" specifiers to it as > appropriate, to better document the intent of the decls? >=20 The D parser code is written in D, but most of it is marked "extern(C++)" so that the code generator can interface with it. It is already a hard requirement in D that all overriden method have the "override" keyword, and "final" is already tacked on most places, so for the most part it is already there, just hasn't been mirrored to the C++ interfaces in the headers. I'll have a look into it. Iain.