PR libstdc++/79513
* include/std/variant (visit()): Forward variant types to the return
type detection code.
* testsuite/20_util/variant/compile.cc: Add test cases.
From-SVN: r245474
+2017-02-15 Tim Shen <timshen@google.com>
+
+ PR libstdc++/79513
+ * include/std/variant (visit()): Forward variant types to the return
+ type detection code.
+ * testsuite/20_util/variant/compile.cc: Add test cases.
+
2017-02-13 H.J. Lu <hongjiu.lu@intel.com>
PR libstdc++/79348
__throw_bad_variant_access("Unexpected index");
using _Result_type =
- decltype(std::forward<_Visitor>(__visitor)(get<0>(__variants)...));
+ decltype(std::forward<_Visitor>(__visitor)(
+ get<0>(std::forward<_Variants>(__variants))...));
constexpr auto& __vtable = __detail::__variant::__gen_vtable<
_Result_type, _Visitor&&, _Variants&&...>::_S_vtable;
};
static_assert(visit(Visitor(), variant<int, nonliteral>(0)), "");
}
+ // PR libstdc++/79513
+ {
+ std::variant<int> v [[gnu::unused]] (5);
+ std::visit([](int&){}, v);
+ std::visit([](int&&){}, std::move(v));
+ }
}
void test_constexpr()