[PATCH RFC] libstdc++: use contract_assert for __glibcxx_assert

Jonathan Wakely jwakely@redhat.com
Mon Nov 16 12:30:52 GMT 2026


On Mon, 16 Nov 2026 at 12:07, Tomasz Kaminski <tkaminsk@redhat.com> wrote:
>
>
>
> On Fri, Nov 13, 2026 at 9:51 PM Jason Merrill <jason@redhat.com> wrote:
>>
>> Tested x86_64-pc-linux-gnu.
>>
>> I assume you don't want to condition this on only __cpp_contracts as in the
>> current patch.  And I don't know how you want to handle the view_interface
>> empty() issue.
>
> Constification does not apply to the object pointed to by the pointers, so we could simply do:
> view_interface* __self = this;
> __glibcxx_assert(__self->empty());

I think that's the best of the alternatives suggested so far.



More information about the Libstdc++ mailing list