summaryrefslogtreecommitdiffstats
path: root/libcxx/include/__bit_reference
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2012-05-07 16:50:38 +0000
committerHoward Hinnant <hhinnant@apple.com>2012-05-07 16:50:38 +0000
commit0ae9efeb1a14a665a0f5d6819e25a83cc6ea348a (patch)
tree58e9ae0b2d978910d723a7c8b2ca8d3bb5fb2ca2 /libcxx/include/__bit_reference
parentbcaa94db6c4018314cf2f050711a35e9afac8cb8 (diff)
downloadbcm5719-llvm-0ae9efeb1a14a665a0f5d6819e25a83cc6ea348a.tar.gz
bcm5719-llvm-0ae9efeb1a14a665a0f5d6819e25a83cc6ea348a.zip
SFINAE __bit_iterator such that it will only get instantiated with a container that has the nested type __storage_type. This prevents accidental instantiation such as in http://llvm.org/bugs/show_bug.cgi?id=12755. This fixes http://llvm.org/bugs/show_bug.cgi?id=12755.
llvm-svn: 156308
Diffstat (limited to 'libcxx/include/__bit_reference')
-rw-r--r--libcxx/include/__bit_reference5
1 files changed, 3 insertions, 2 deletions
diff --git a/libcxx/include/__bit_reference b/libcxx/include/__bit_reference
index 906b9da462e..bc34555aa07 100644
--- a/libcxx/include/__bit_reference
+++ b/libcxx/include/__bit_reference
@@ -22,7 +22,7 @@
_LIBCPP_BEGIN_NAMESPACE_STD
-template <class _Cp, bool _IsConst> class __bit_iterator;
+template <class _Cp, bool _IsConst, typename _Cp::__storage_type = 0> class __bit_iterator;
template <class _Cp> class __bit_const_reference;
template <class _Tp>
@@ -1057,7 +1057,8 @@ equal(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __b
return __equal_unaligned(__first1, __last1, __first2);
}
-template <class _Cp, bool _IsConst>
+template <class _Cp, bool _IsConst,
+ typename _Cp::__storage_type>
class __bit_iterator
{
public:
OpenPOWER on IntegriCloud