===================================================================
@@ -51,7 +51,7 @@
public:
// In C++0x we rely on normal reference type to preserve the property
// of bitset to be use as a literal.
- // TODO: Find an other solution.
+ // TODO: Find another solution.
#ifdef __GXX_EXPERIMENTAL_CXX0X__
typedef typename _Base::reference reference;
#else
@@ -272,11 +272,14 @@
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 11. Bitset minor problems
- bool
+ _GLIBCXX_CONSTEXPR bool
operator[](size_t __pos) const
{
+#ifndef __GXX_EXPERIMENTAL_CXX0X__
+ // TODO: Check in debug-mode too.
__glibcxx_check_subscript(__pos);
- return _M_base()[__pos];
+#endif
+ return _Base::operator[](__pos);
}
using _Base::to_ulong;
===================================================================
@@ -232,10 +232,10 @@
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 11. Bitset minor problems
- bool
+ _GLIBCXX_CONSTEXPR bool
operator[](size_t __pos) const
{
- return _M_base()[__pos];
+ return _Base::operator[](__pos);
}
using _Base::to_ulong;
===================================================================
@@ -1,4 +1,5 @@
// { dg-do compile }
+// { dg-require-normal-mode "" }
// { dg-options "-std=gnu++0x" }
// Copyright (C) 2011 Free Software Foundation, Inc.
@@ -31,10 +32,5 @@
auto r2 __attribute__((unused)) = base._M_getdata();
constexpr auto r3 __attribute__((unused)) = base._M_hiword();
- // bitset operators
- typedef std::bitset<6> bitset_type;
- constexpr bitset_type a = bitset_type();
- constexpr auto v __attribute__((unused)) = a[0];
-
return 0;
}
===================================================================
@@ -22,15 +22,6 @@
int main()
{
- // bitset base type
- typedef std::_Base_bitset<6> bitset_base;
- constexpr bitset_base base = bitset_base();
-
- constexpr auto r1 __attribute__((unused)) = base._M_getword(2);
- // constexpr auto r2 = base._M_getdata(); // error, pointer to this
- auto r2 __attribute__((unused)) = base._M_getdata();
- constexpr auto r3 __attribute__((unused)) = base._M_hiword();
-
// bitset operators
typedef std::bitset<6> bitset_type;
constexpr bitset_type a = bitset_type();