summaryrefslogtreecommitdiffstats
path: root/libcxx/include/bitset
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/bitset
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/bitset')
-rw-r--r--libcxx/include/bitset6
1 files changed, 3 insertions, 3 deletions
diff --git a/libcxx/include/bitset b/libcxx/include/bitset
index 6e12e5ccc51..b3a58673105 100644
--- a/libcxx/include/bitset
+++ b/libcxx/include/bitset
@@ -148,9 +148,9 @@ class __bitset
public:
typedef ptrdiff_t difference_type;
typedef size_t size_type;
+ typedef size_type __storage_type;
protected:
typedef __bitset __self;
- typedef size_type __storage_type;
typedef __storage_type* __storage_pointer;
typedef const __storage_type* __const_storage_pointer;
static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);
@@ -406,9 +406,9 @@ class __bitset<1, _Size>
public:
typedef ptrdiff_t difference_type;
typedef size_t size_type;
+ typedef size_type __storage_type;
protected:
typedef __bitset __self;
- typedef size_type __storage_type;
typedef __storage_type* __storage_pointer;
typedef const __storage_type* __const_storage_pointer;
static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);
@@ -549,9 +549,9 @@ class __bitset<0, 0>
public:
typedef ptrdiff_t difference_type;
typedef size_t size_type;
+ typedef size_type __storage_type;
protected:
typedef __bitset __self;
- typedef size_type __storage_type;
typedef __storage_type* __storage_pointer;
typedef const __storage_type* __const_storage_pointer;
static const unsigned __bits_per_word = static_cast<unsigned>(sizeof(__storage_type) * CHAR_BIT);
OpenPOWER on IntegriCloud