[cfe-commits] [libcxx] r131852 - /libcxx/trunk/include/functional
Howard Hinnant
hhinnant at apple.com
Sun May 22 08:07:43 PDT 2011
Author: hhinnant
Date: Sun May 22 10:07:43 2011
New Revision: 131852
URL: http://llvm.org/viewvc/llvm-project?rev=131852&view=rev
Log:
Fix const correctness bug in bind involving reference_wrapper found by Jonathan Sauer
Modified:
libcxx/trunk/include/functional
Modified: libcxx/trunk/include/functional
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/functional?rev=131852&r1=131851&r2=131852&view=diff
==============================================================================
--- libcxx/trunk/include/functional (original)
+++ libcxx/trunk/include/functional Sun May 22 10:07:43 2011
@@ -1567,24 +1567,31 @@
return __ti;
}
-template <class _Ti, bool IsBindEx, bool IsPh, class _TupleUj>
+template <class _Ti, bool IsReferenceWrapper, bool IsBindEx, bool IsPh,
+ class _TupleUj>
struct ____mu_return;
template <class _Ti, class ..._Uj>
-struct ____mu_return<_Ti, true, false, tuple<_Uj...> >
+struct ____mu_return<_Ti, false, true, false, tuple<_Uj...> >
{
typedef typename __invoke_of<_Ti&, _Uj...>::type type;
};
template <class _Ti, class _TupleUj>
-struct ____mu_return<_Ti, false, true, _TupleUj>
+struct ____mu_return<_Ti, false, false, true, _TupleUj>
{
typedef typename tuple_element<is_placeholder<_Ti>::value - 1,
_TupleUj>::type&& type;
};
template <class _Ti, class _TupleUj>
-struct ____mu_return<_Ti, false, false, _TupleUj>
+struct ____mu_return<_Ti, true, false, false, _TupleUj>
+{
+ typedef typename _Ti::type& type;
+};
+
+template <class _Ti, class _TupleUj>
+struct ____mu_return<_Ti, false, false, false, _TupleUj>
{
typedef _Ti& type;
};
@@ -1592,18 +1599,13 @@
template <class _Ti, class _TupleUj>
struct __mu_return
: public ____mu_return<_Ti,
+ __is_reference_wrapper<_Ti>::value,
is_bind_expression<_Ti>::value,
0 < is_placeholder<_Ti>::value,
_TupleUj>
{
};
-template <class _Ti, class _TupleUj>
-struct __mu_return<reference_wrapper<_Ti>, _TupleUj>
-{
- typedef _Ti& type;
-};
-
template <class _F, class _BoundArgs, class _TupleUj>
struct __bind_return;
More information about the cfe-commits
mailing list