]> git.ipfire.org Git - thirdparty/gcc.git/commit
libstdc++: Allow visiting inherited variants [PR 90943]
authorJonathan Wakely <jwakely@redhat.com>
Mon, 19 Apr 2021 13:49:12 +0000 (14:49 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Fri, 1 Oct 2021 19:34:48 +0000 (20:34 +0100)
commitc46ecb0112e91c80ee111439e79a58a953e4479d
tree45bda3f165e02e455b4ea52cb5b68e35911b8778
parentfb4d55ef61ca3191ec946d4d41e0e715f4cc4197
libstdc++: Allow visiting inherited variants [PR 90943]

Implement the changes from P2162R2 (as a DR for C++17).

Signed-off-by: Jonathan Wakely <jwakely@redhat.com>
libstdc++-v3/ChangeLog:

PR libstdc++/90943
* include/std/variant (__cpp_lib_variant): Update value.
(__detail::__variant::__as): New helpers implementing the
as-variant exposition-only function templates.
(visit, visit<R>): Use __as to upcast the variant parameters.
* include/std/version (__cpp_lib_variant): Update value.
* testsuite/20_util/variant/visit_inherited.cc: New test.
libstdc++-v3/include/std/variant
libstdc++-v3/include/std/version
libstdc++-v3/testsuite/20_util/variant/visit_inherited.cc [new file with mode: 0644]