https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118341
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- The debug bitset also does checking in its reference type, but only for C++98: // In C++11 we rely on normal reference type to preserve the property // of bitset to be use as a literal. // TODO: Find another solution. #if __cplusplus >= 201103L typedef typename _Base::reference reference; #else // bit reference: class reference : private _Base::reference , public __gnu_debug::_Safe_iterator_base { That should be revisited.