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
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 0ae9efeb1a14a665a0f5d6819e25a83cc6ea348a
diff --git a/include/bitset b/include/bitset
index 6e12e5c..b3a5867 100644
--- a/include/bitset
+++ b/include/bitset
@@ -148,9 +148,9 @@
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 @@
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 @@
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);