https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84998

            Bug ID: 84998
           Summary: [8 Regression] std::hash<std::bitset<N>> fails in
                    Debug Mode
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---

#define _GLIBCXX_DEBUG
#include <bitset>
int main()
{
  std::bitset<1> b;
  std::hash<std::bitset<1>> h;
  return h(b);
}

In file included from bs.cc:2:
/home/jwakely/gcc/8/include/c++/8.0.1/bitset: In instantiation of 'std::size_t
std::hash<std::__cxx1998::bitset<_Nb> >::operator()(const
std::__cxx1998::bitset<_Nb>&) const [with long unsigned int _Nb = 1;
std::size_t = long unsigned int]':
/home/jwakely/gcc/8/include/c++/8.0.1/debug/bitset:421:56:   required from
'std::size_t std::hash<std::__debug::bitset<_Nb> >::operator()(const
std::__debug::bitset<_Nb>&) const [with long unsigned int _Nb = 1; std::size_t
= long unsigned int]'
bs.cc:7:13:   required from here
/home/jwakely/gcc/8/include/c++/8.0.1/bitset:1568:30: error: 'const _WordT*
std::__cxx1998::_Base_bitset<1>::_M_getdata() const' is inaccessible within
this context
  return std::_Hash_impl::hash(__b._M_getdata(), __clength);
         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/jwakely/gcc/8/include/c++/8.0.1/bitset:415:7: note: declared here
       _M_getdata() const noexcept
       ^~~~~~~~~~
/home/jwakely/gcc/8/include/c++/8.0.1/bitset:1568:30: error:
'std::__cxx1998::_Base_bitset<1>' is not an accessible base of 'const
std::__cxx1998::bitset<1>'
  return std::_Hash_impl::hash(__b._M_getdata(), __clength);
         ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to