This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++ committed] Fix ICE with -Wshadow=compatible-local (PR c++/81640)
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Nathan Sidwell <nathan at acm dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 4 Aug 2017 18:58:21 +0200
- Subject: Re: [C++ committed] Fix ICE with -Wshadow=compatible-local (PR c++/81640)
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=jakub at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1211746269
- References: <20170802073801.GH2123@tucnak> <CADzB+2=dojx6Q0XLH5MQJ-gwtUX8+jGZHwKDHAL5Uk3mz73sSA@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Fri, Aug 04, 2017 at 12:50:36PM -0400, Jason Merrill wrote:
> On Wed, Aug 2, 2017 at 3:38 AM, Jakub Jelinek <jakub@redhat.com> wrote:
> > I've bootstrapped/regtested the following patch last night and committed
> > after preapproval from Nathan, though of course a question is if
> > lookup_fnfields_slot/lookup_fnfields_slot_nolazy shouldn't have
> > if (!CLASS_TYPE_P (type)) return NULL_TREE; or
> > gcc_assert (!CLASS_TYPE_P (type));
> > readded to the beginning of those functions.
>
> It seems that we already ICE if we call it with a non-class type, so
> adding an assert would just document that behavior?
CLASSTYPE_METHOD_VEC doesn't exactly check CLASS_TYPE_P if checking,
it just requires that LANG_TYPE_CLASS_CHECK is non-NULL (dunno if there
are any non-CLASS_TYPE_P types that have it non-NULL, or any CLASS_TYPE_P
types that have it NULL).
But yes, for checking builds it would be primarily documentation, for
checking builds likely too, because if TYPE_LANG_SPECIFIC is NULL,
then CLASSTYPE_METHOD_VEC will dereference NULL.
Jakub