libstdc++: Fix visitor return type diagnostics [PR97499]
Ville Voutilainen
ville.voutilainen@gmail.com
Fri Oct 16 07:26:29 GMT 2020
Tested on Linux-PPC64. I haven't tested this with clang yet,
Jonathan, can you help with that? The previous implementation
indeed made an if-constexpr branch invalid for all instantiations
of that branch, this one doesn't - now we have just a dependent static_assert
which is well-formed for correct visitors and ill-formed for incorrect
visitors.
2020-10-16 Ville Voutilainen <ville.voutilainen@gmail.com>
PR libstdc++/97449
* include/std/variant
(__gen_vtable_impl<>::_S_apply_single_alt):
Diagnose visitor return type mismatches here..
(__gen_vtable_impl</*base case*/>::_S_apply):
..not here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr97449.diff
Type: text/x-patch
Size: 1136 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/gcc-patches/attachments/20201016/53c73754/attachment.bin>
More information about the Gcc-patches
mailing list