diff options
author | Eric Fiselier <eric@efcs.ca> | 2017-02-09 19:01:22 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2017-02-09 19:01:22 +0000 |
commit | a18ef6f1f9d2a32519192feedadb7814461db488 (patch) | |
tree | 4fc1e1307463d028cfcdc4661bc1dab955142192 /libcxx/include/variant | |
parent | 29eeea00e12ee33728ead258c7d6466d79f8ca1d (diff) | |
download | bcm5719-llvm-a18ef6f1f9d2a32519192feedadb7814461db488.tar.gz bcm5719-llvm-a18ef6f1f9d2a32519192feedadb7814461db488.zip |
Fix PR31916 - std::visit rejects visitors accepting lvalue arguments
A static assertion was misfiring since it checked
is_callable<Visitor, decltype(__variant_alt<T>.value)>. However
the decltype expression doesn't capture the value category as
required. This patch applies extra braces to decltype to fix
that.
llvm-svn: 294612
Diffstat (limited to 'libcxx/include/variant')
-rw-r--r-- | libcxx/include/variant | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcxx/include/variant b/libcxx/include/variant index fb7cb2e20e5..099e6c35849 100644 --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -578,7 +578,7 @@ private: constexpr decltype(auto) operator()(_Alts&&... __alts) const { __std_visit_exhaustive_visitor_check< _Visitor, - decltype(_VSTD::forward<_Alts>(__alts).__value)...>(); + decltype((_VSTD::forward<_Alts>(__alts).__value))...>(); return __invoke_constexpr(_VSTD::forward<_Visitor>(__visitor), _VSTD::forward<_Alts>(__alts).__value...); } |