On Sun, 3 Oct 2021 at 10:07, Jonathan Wakely wrote: > > > > On Sat, 2 Oct 2021, 13:50 Daniel Krügler via Libstdc++, wrote: >> >> Am Fr., 1. Okt. 2021 um 21:57 Uhr schrieb Jonathan Wakely via >> Libstdc++ : >> > >> > Implement the changes from P2162R2 (as a DR for C++17). >> > >> > Signed-off-by: Jonathan Wakely >> > >> > 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): Use __as to upcast the variant parameters. >> > * include/std/version (__cpp_lib_variant): Update value. >> > * testsuite/20_util/variant/visit_inherited.cc: New test. >> > >> > Tested powerpc64le-linux. Committed to trunk. >> > >> >> I'm wondering why the first __as overload is not noexcept as well (or >> asking it the other way around: Why different exception-specifications >> are used for the different overloads): >> >> + // The __as function templates implement the exposition-only "as-variant" >> + >> + template >> + constexpr std::variant<_Types...>& >> + __as(std::variant<_Types...>& __v) >> + { return __v; } > > > Probably just an oversight, I'll check again and fix it. Thanks! Fixed by the attached patch, thanks again. Tested powerpc64le-linux, pushed to trunk.