diff options
author | Eric Fiselier <eric@efcs.ca> | 2014-12-23 05:54:34 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2014-12-23 05:54:34 +0000 |
commit | 60b3df404e59b3b795858299e8818b1c977f7e50 (patch) | |
tree | 8eefb722270b1668cfcdee8286b8e833e7b1d286 /include/functional | |
parent | e26488fd8378dc5aee5bb78448a8b32d319c2556 (diff) |
Prevent ill-formed instantiation of __invoke_of<...> during the evaluation of a bind expression. Fixes PR22003.
The SFINAE on the function __mu(Fn, Args...) that evaluates nested bind
expressions always tries to deduce the return type for Fn(Args...) even when Fn
is not a nested bind expression. This can cause hard compile errors when the
instantation of Fn(Args...) is ill-formed. This patch prevents the instantation
of __invoke_of<Fn, Args...> unless Fn is actually a bind expression.
Bug reportand patch from Michel Morin.
http://llvm.org/bugs/show_bug.cgi?id=22003
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@224753 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/functional')
-rw-r--r-- | include/functional | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/functional b/include/functional index 416a9a97f..d14b46bb7 100644 --- a/include/functional +++ b/include/functional @@ -1863,10 +1863,10 @@ __mu_expand(_Ti& __ti, tuple<_Uj...>& __uj, __tuple_indices<_Indx...>) template <class _Ti, class ..._Uj> inline _LIBCPP_INLINE_VISIBILITY -typename enable_if +typename __lazy_enable_if < is_bind_expression<_Ti>::value, - typename __invoke_of<_Ti&, _Uj...>::type + __invoke_of<_Ti&, _Uj...> >::type __mu(_Ti& __ti, tuple<_Uj...>& __uj) { |