This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: PR libstdc++/80064 make heap algorithms work with function types
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Ville Voutilainen <ville dot voutilainen at gmail dot com>
- Cc: libstdc++ <libstdc++ at gcc dot gnu dot org>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Richard Biener <rguenther at suse dot de>
- Date: Thu, 16 Mar 2017 13:44:09 +0000
- Subject: Re: RFC: PR libstdc++/80064 make heap algorithms work with function types
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=jwakely at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 072BFC04B945
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 072BFC04B945
- References: <20170316130232.GA2682@redhat.com> <CAFk2RUZMXCWewu-hmY08q8qaUe3B3jSEu2zRjB0j+_VqnDWnbQ@mail.gmail.com>
On 16/03/17 15:31 +0200, Ville Voutilainen wrote:
All in all it seems to some extent reasonable to me to allow such
code. It seems rather easy
to fail to provide a function pointer as the comparator type, but also
rather easy for the implementation
to not mind that. I do find it suspicious that any user code would
bother providing the comparator
type as a template argument, though; whenever users feel encouraged to
do that, trouble ensues.
At this point I'm gravitating towards fixing the regression now, and
possibly being more stringent in the next
release, meaning gcc 8.
Yeah, we could add a static_assert with a user-friendly message
telling them why the code is invalid, instead of an impenetrable error
about internal implementation details.
So I'll commit the fix, treating it as a regression.