[patch, libstdc++] In debug mode, diagnose empty initializer_list in min/max/minmax

Eelis van der Weegen eelis@eelis.net
Thu Feb 25 20:07:00 GMT 2016


On 2016-02-23 23:39, Jonathan Wakely wrote:
> On 23/02/16 22:03 +0100, Eelis wrote:
>> The std::min, std::max, and std::minmax overloads that take a std::initializer_list all require that the list is not empty. The attached patch adds debug mode checks for this.
>
> Nice, thanks for the patch.

Hi Jonathan,

Thanks for the review! Updated patch attached.

I couldn't find precedent in the libstdc++ testsuite of tests that test __glibcxx_assert assertions, so I put these under {min,max,minmax}/assert/, analogous to {min,max,minmax}/debug/. Is that ok?

> Otherwise this looks good, but will have to wait until after the GCC 6 release now.

No hurry at all. :)

Cheers,

Eelis
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diagnose_empty_init_list_in_minmax.patch
Type: text/x-patch
Size: 13139 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20160225/6ab12688/attachment.bin>


More information about the Libstdc++ mailing list