From 2229fffd9507c1d41fd983d124398662de7cdfd0 Mon Sep 17 00:00:00 2001
From: Allan Sandfeld Jensen <allan.jensen@qt.io>
Date: Mon, 3 Apr 2017 16:49:06 +0200
Subject: [PATCH] Fix build with GCC 7.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes a few problems with using undeclared functions and ambigious
code.

Task-number: QTBUG-59776
Change-Id: Ifcaecda4d210c52362616d984bd1259fc763874c
Reviewed-by: Michael Brüning <michael.bruning@qt.io>
---
 .../platform/graphics/gpu/SharedGpuContext.h   |  1 +
 .../WebKit/Source/wtf/LinkedHashSet.h          |  2 ++
 chromium/v8/src/objects-body-descriptors.h     |  2 +-
 chromium/v8/src/objects-inl.h                  | 18 ++++++++++++++++++
 chromium/v8/src/objects.h                      | 16 ++--------------
 5 files changed, 24 insertions(+), 15 deletions(-)

diff --git a/chromium/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h b/chromium/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h
index 7c320073461..dd2d6370853 100644
--- a/chromium/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h
+++ b/chromium/third_party/WebKit/Source/platform/graphics/gpu/SharedGpuContext.h
@@ -5,6 +5,7 @@
 #include "platform/PlatformExport.h"
 #include "wtf/ThreadSpecific.h"
 
+#include <functional>
 #include <memory>
 
 namespace gpu {
diff --git a/chromium/third_party/WebKit/Source/wtf/LinkedHashSet.h b/chromium/third_party/WebKit/Source/wtf/LinkedHashSet.h
index 65f5100a8f1..831bb23a55c 100644
--- a/chromium/third_party/WebKit/Source/wtf/LinkedHashSet.h
+++ b/chromium/third_party/WebKit/Source/wtf/LinkedHashSet.h
@@ -630,6 +630,8 @@ inline LinkedHashSet<T, U, V, W>& LinkedHashSet<T, U, V, W>::operator=(
   return *this;
 }
 
+inline void swapAnchor(LinkedHashSetNodeBase& a, LinkedHashSetNodeBase& b);
+
 template <typename T, typename U, typename V, typename W>
 inline void LinkedHashSet<T, U, V, W>::swap(LinkedHashSet& other) {
   m_impl.swap(other.m_impl);
diff --git a/chromium/v8/src/objects-body-descriptors.h b/chromium/v8/src/objects-body-descriptors.h
index 91cb8883be8..a1c3634bd76 100644
--- a/chromium/v8/src/objects-body-descriptors.h
+++ b/chromium/v8/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);
   }
 };
 
diff --git a/chromium/v8/src/objects-inl.h b/chromium/v8/src/objects-inl.h
index 1a8274cbf12..47d3448c5f6 100644
--- a/chromium/v8/src/objects-inl.h
+++ b/chromium/v8/src/objects-inl.h
@@ -7975,6 +7975,24 @@ bool GlobalDictionaryShape::IsDeleted(Dictionary* dict, int entry) {
 }
 
 
+template <typename Derived, typename Shape, typename Key>
+inline 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>
+inline 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);
+  }
+}
+
 bool ObjectHashTableShape::IsMatch(Handle<Object> key, Object* other) {
   return key->SameValue(other);
 }
diff --git a/chromium/v8/src/objects.h b/chromium/v8/src/objects.h
index 747a4f0511d..53bc4a5502d 100644
--- a/chromium/v8/src/objects.h
+++ b/chromium/v8/src/objects.h
@@ -3532,21 +3532,9 @@ class HashTable : public HashTableBase {
   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 Hash(Key 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 HashForObject(Key key, Object* object);
 
   // Returns a new HashTable object.
   MUST_USE_RESULT static Handle<Derived> New(
-- 
GitLab