]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
hashtable.cc (__access_protected_ctor): Define and use new type instead of _Hashtable...
authorJonathan Wakely <jwakely.gcc@gmail.com>
Tue, 29 Oct 2013 21:19:34 +0000 (21:19 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Tue, 29 Oct 2013 21:19:34 +0000 (21:19 +0000)
* include/bits/hashtable.cc (__access_protected_ctor): Define and use
new type instead of _Hashtable_ebo_helper.
* testsuite/23_containers/unordered_set/
not_default_constructible_hash_neg.cc: Adjust line number.

From-SVN: r204182

libstdc++-v3/ChangeLog
libstdc++-v3/include/bits/hashtable.h
libstdc++-v3/testsuite/23_containers/unordered_set/not_default_constructible_hash_neg.cc

index 1b83aa5aa658680ba3d670d9125f91ad6666086a..117f6d7791ebe0caffb0bc25458c2bf4709b08fb 100644 (file)
@@ -1,3 +1,10 @@
+2013-10-29  Jonathan Wakely  <jwakely.gcc@gmail.com>
+
+       * include/bits/hashtable.cc (__access_protected_ctor): Define and use
+       new type instead of _Hashtable_ebo_helper.
+       * testsuite/23_containers/unordered_set/
+       not_default_constructible_hash_neg.cc: Adjust line number.
+
 2013-10-28  Tim Shen  <timshen91@gmail.com>
 
        * regex_executor.tcc: Add comments.
index c639c553d34afad8e0dd08591db68063b9aa8338..aae146b41be40a089612f3255fc6e94c6ccc295f 100644 (file)
@@ -277,14 +277,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
                    "Functor used to map hash code to bucket index"
                    " must be default constructible");
 
+      // _Hash_code_base has a protected default constructor, so use this
+      // derived type to tell if it's usable.
+      struct __access_protected_ctor : __hash_code_base { };
+
       // When hash codes are not cached local iterator inherits from
       // __hash_code_base above to compute node bucket index so it has to be
       // default constructible.
       static_assert(__if_hash_not_cached<
-                   is_default_constructible<
-                     // We use _Hashtable_ebo_helper to access the protected
-                     // default constructor.
-                     __detail::_Hashtable_ebo_helper<0, __hash_code_base, true>>>::value,
+                   is_default_constructible<__access_protected_ctor>>::value,
                    "Cache the hash code or make functors involved in hash code"
                    " and bucket index computation default constructible");
 
index 3332cc593cdf280b09b162858cdb4270bac1f629..4216b91c29142cf137d2a0398f465a0def451d27 100644 (file)
@@ -19,7 +19,7 @@
 // with this library; see the file COPYING3.  If not see
 // <http://www.gnu.org/licenses/>.
 
-// { dg-error "default constructible" "" { target *-*-* } 283 }
+// { dg-error "default constructible" "" { target *-*-* } 287 }
 
 #include <unordered_set>