[PATCH] PR libstdc++/71579 assert that type traits are not misused with an incomplete type

Antony Polukhin antoshkka@gmail.com
Thu Jun 20 18:56:00 GMT 2019


чт, 20 июн. 2019 г. в 20:57, Ville Voutilainen <ville.voutilainen@gmail.com>:
>
> On Thu, 20 Jun 2019 at 20:49, Antony Polukhin <antoshkka@gmail.com> wrote:
> >
> > чт, 6 июн. 2019 г. в 15:19, Jonathan Wakely <jwakely@redhat.com>:
> > > I'm removing some of these assertions again, because they are either
> > > reundant or wrong.
> >
> > Thanks for cleaning up!
> >
> >
> > In attachment there is an additional patch for type traits hardening.
> >
> > Things that still remain unasserted are type traits  with variadic
> > template arguments. I have to came up with a proper solution for
> > providing a useful and lightweight diagnostics.
>
> I see a
> public __bool_constant<__is_trivially_assignable(_Tp, _Up)>
> in this patch, followed by a trait-body that static_asserts. In such
> cases, I think we want
> to
> a) be really careful about duplicating compiler diagnostics with library ones
> b) look at the compiler diagnostics, and if they are lacking, improve them.
>
> ...because that's what Jonathan's cleanup was really about.
> In the test modifications of __is_trivially_assignable, this looks bloody
> suspicious:
>
> +// { dg-prune-output "invalid use of incomplete type" }
> +// { dg-prune-output "must be a complete" }
>
> No. Don't merge. We are not replacing diagnostics A with diagnostics
> B, we are ignoring existing
> diagnostics and adding more. Which is exactly what Jonathan's cleanup avoided.

Thanks for the review and clarifications. I'll fix the patch.



-- 
Best regards,
Antony Polukhin



More information about the Libstdc++ mailing list