This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/56267] New: [4.7/4.8 Regression] unordered containers require Assignable hash function


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56267

             Bug #: 56267
           Summary: [4.7/4.8 Regression] unordered containers require
                    Assignable hash function
    Classification: Unclassified
           Product: gcc
           Version: 4.7.3
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: redi@gcc.gnu.org


#include <unordered_set>

struct hash : std::hash<int>
{
  hash& operator=(const hash&) = delete;
};

int main()
{
  std::unordered_set<int, hash> s{ 0, 1, 2 };
  auto i = s.begin(0);
  i = i;
}


The standard does not require hash functions to be assignable.

We must cache the hash code unless is_copy_assignable<H> is true, I'm testing
the fix.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]