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 c++/80981] [7/8 Regression] couldn't deduce template parameter for an obvious case


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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|REOPENED                    |RESOLVED
         Resolution|---                         |INVALID

--- Comment #5 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
For v8 you need the following patch:

diff --git a/src/objects-body-descriptors.h b/src/objects-body-descriptors.h
index 499c48a93034..3eb3bb539e4d 100644
--- a/src/objects-body-descriptors.h
+++ b/src/objects-body-descriptors.h
@@ -99,7 +99,7 @@ class FixedBodyDescriptor final : public BodyDescriptorBase {

   template <typename StaticVisitor>
   static inline void IterateBody(HeapObject* obj, int object_size) {
-    IterateBody(obj);
+    IterateBody<StaticVisitor>(obj);
   }

   static inline int SizeOf(Map* map, HeapObject* object) { return kSize; }
diff --git a/src/objects-inl.h b/src/objects-inl.h
index 2eeac7f7e0bd..636be371d315 100644
--- a/src/objects-inl.h
+++ b/src/objects-inl.h
@@ -48,6 +48,27 @@
 namespace v8 {
 namespace internal {

+template <typename Derived, typename Shape, typename Key>
+uint32_t HashTable<Derived, Shape, Key>::Hash(Key key) {
+  if (Shape::UsesSeed) {
+    return Shape::SeededHash(key, GetHeap()->HashSeed());
+  } else {
+    return Shape::Hash(key);
+  }
+}
+
+
+template <typename Derived, typename Shape, typename Key>
+uint32_t HashTable<Derived, Shape, Key>::HashForObject(Key key,
+                                                       Object* object) {
+  if (Shape::UsesSeed) {
+    return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object);
+  } else {
+    return Shape::HashForObject(key, object);
+  }
+}
+
+
 PropertyDetails::PropertyDetails(Smi* smi) {
   value_ = smi->value();
 }
diff --git a/src/objects/hash-table.h b/src/objects/hash-table.h
index 1a5d73eb4e30..1095d447a23d 100644
--- a/src/objects/hash-table.h
+++ b/src/objects/hash-table.h
@@ -138,22 +138,8 @@ class HashTable : public HashTableBase {
  public:
   typedef Shape ShapeT;

-  // Wrapper methods
-  inline uint32_t Hash(Key key) {
-    if (Shape::UsesSeed) {
-      return Shape::SeededHash(key, GetHeap()->HashSeed());
-    } else {
-      return Shape::Hash(key);
-    }
-  }
-
-  inline uint32_t HashForObject(Key key, Object* object) {
-    if (Shape::UsesSeed) {
-      return Shape::SeededHashForObject(key, GetHeap()->HashSeed(), object);
-    } else {
-      return Shape::HashForObject(key, object);
-    }
-  }
+  inline uint32_t Hash(Key key);
+  inline uint32_t HashForObject(Key key, Object* object);

   // Returns a new HashTable object.
   MUST_USE_RESULT static Handle<Derived> New(

The first hunk fixes the issue. This is already fixed in node.js,
see: https://github.com/nodejs/node/issues/10388

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