]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - libstdc++-v3/include/tr1/functional_hash.h
Update copyright years.
[thirdparty/gcc.git] / libstdc++-v3 / include / tr1 / functional_hash.h
index 1742e15278863da2995b0909d6b3116d324063a8..6a0f75b88589cb9f53d4886cdbf46d65c558a3e1 100644 (file)
@@ -1,6 +1,6 @@
 // TR1 functional_hash.h header -*- C++ -*-
 
-// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+// Copyright (C) 2007-2022 Free Software Foundation, Inc.
 //
 // This file is part of the GNU ISO C++ Library.  This library is free
 // software; you can redistribute it and/or modify it under the
 
 namespace std _GLIBCXX_VISIBILITY(default)
 {
-namespace tr1
-{
 _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
+namespace tr1
+{
   /// Class template hash.
   // Declaration of default hash functor std::tr1::hash.  The types for
   // which std::tr1::hash<T> is well-defined is in clause 6.3.3. of the PDTR.
@@ -83,6 +83,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   // Fowler / Noll / Vo (FNV) Hash (type FNV-1a)
   // (Used by the next specializations of std::tr1::hash.)
 
+  // N.B. These functions should work on unsigned char, otherwise they do not
+  // correctly implement the FNV-1a algorithm (see PR59406).
+  // The existing behaviour is retained for backwards compatibility.
+
   /// Dummy generic implementation (for sizeof(size_t) != 4, 8).
   template<size_t>
     struct _Fnv_hash_base
@@ -188,9 +192,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     _GLIBCXX_PURE size_t
     hash<const wstring&>::operator()(const wstring&) const;
 #endif
+}
 
 _GLIBCXX_END_NAMESPACE_VERSION
 }
-}
 
 #endif // _GLIBCXX_TR1_FUNCTIONAL_HASH_H