[PATCH] libstdc++: Diagnose visitors with different return types [PR95904]
Ville Voutilainen
ville.voutilainen@gmail.com
Mon Oct 5 19:35:04 GMT 2020
On Mon, 5 Oct 2020 at 01:15, Ville Voutilainen
<ville.voutilainen@gmail.com> wrote:
> The patch is borked, doesn't pass tests, fixing...
Unborked, ok for trunk if full testsuite passes?
2020-10-05 Ville Voutilainen <ville.voutilainen@gmail.com>
PR libstdc++/95904
* include/std/variant (__deduce_visit_result): Add a nested ::type.
(__gen_vtable_impl</*base case*/>::_S_apply):
Check the visitor return type.
(__same_types): New.
(__check_visitor_result): Likewise.
(__check_visitor_results): Likewise.
(visit(_Visitor&&, _Variants&&...)): Use __check_visitor_results
in case we're visiting just one variant.
* testsuite/20_util/variant/visit_neg.cc: Adjust.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr95904_4.diff
Type: text/x-patch
Size: 4080 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201005/15be110b/attachment.bin>
More information about the Gcc-patches
mailing list