From 5dbbf8991de1fc28eee8764d21827dfd0ac69f2d Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Fri, 9 Mar 2018 01:10:02 +0000 Subject: [PATCH] PR libstdc++/84769 qualify std::get and std::get_if to avoid ADL PR libstdc++/84769 * include/std/variant (get<_Tp, _Types...>, get_if<_Tp, _Types...>): Qualify calls to get<_Np, Types...> and get_if<_Np, _Types...>. From-SVN: r258376 --- libstdc++-v3/ChangeLog | 4 ++++ libstdc++-v3/include/std/variant | 14 ++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 8e8fa138bfe..ae464ddf9ba 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,9 @@ 2018-03-09 Jonathan Wakely + PR libstdc++/84769 + * include/std/variant (get<_Tp, _Types...>, get_if<_Tp, _Types...>): + Qualify calls to get<_Np, Types...> and get_if<_Np, _Types...>. + src/filesystem/ops.cc (create_dir): Pass error_code to is_directory. src/filesystem/std-ops.cc (create_dir): Likewise. diff --git a/libstdc++-v3/include/std/variant b/libstdc++-v3/include/std/variant index 85a2428715b..4aba131cb73 100644 --- a/libstdc++-v3/include/std/variant +++ b/libstdc++-v3/include/std/variant @@ -891,7 +891,7 @@ namespace __variant static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>, "T should occur for exactly once in alternatives"); static_assert(!is_void_v<_Tp>, "_Tp should not be void"); - return get<__detail::__variant::__index_of_v<_Tp, _Types...>>(__v); + return std::get<__detail::__variant::__index_of_v<_Tp, _Types...>>(__v); } template @@ -900,7 +900,7 @@ namespace __variant static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>, "T should occur for exactly once in alternatives"); static_assert(!is_void_v<_Tp>, "_Tp should not be void"); - return get<__detail::__variant::__index_of_v<_Tp, _Types...>>( + return std::get<__detail::__variant::__index_of_v<_Tp, _Types...>>( std::move(__v)); } @@ -910,7 +910,7 @@ namespace __variant static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>, "T should occur for exactly once in alternatives"); static_assert(!is_void_v<_Tp>, "_Tp should not be void"); - return get<__detail::__variant::__index_of_v<_Tp, _Types...>>(__v); + return std::get<__detail::__variant::__index_of_v<_Tp, _Types...>>(__v); } template @@ -919,7 +919,7 @@ namespace __variant static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>, "T should occur for exactly once in alternatives"); static_assert(!is_void_v<_Tp>, "_Tp should not be void"); - return get<__detail::__variant::__index_of_v<_Tp, _Types...>>( + return std::get<__detail::__variant::__index_of_v<_Tp, _Types...>>( std::move(__v)); } @@ -958,7 +958,8 @@ namespace __variant static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>, "T should occur for exactly once in alternatives"); static_assert(!is_void_v<_Tp>, "_Tp should not be void"); - return get_if<__detail::__variant::__index_of_v<_Tp, _Types...>>(__ptr); + return std::get_if<__detail::__variant::__index_of_v<_Tp, _Types...>>( + __ptr); } template @@ -969,7 +970,8 @@ namespace __variant static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>, "T should occur for exactly once in alternatives"); static_assert(!is_void_v<_Tp>, "_Tp should not be void"); - return get_if<__detail::__variant::__index_of_v<_Tp, _Types...>>(__ptr); + return std::get_if<__detail::__variant::__index_of_v<_Tp, _Types...>>( + __ptr); } struct monostate { }; -- 2.30.2