aboutsummaryrefslogtreecommitdiffstats
path: root/chromium/chromium/chromium-gcc10-r774141.patch
blob: 81c86c129a073e71bfdd5da1a96f7374377ade37 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
From 3b7fd76b6bc43b4a462e296168dc59541a713c11 Mon Sep 17 00:00:00 2001
From: Stephan Hartmann <stha09@googlemail.com>
Date: Tue, 2 Jun 2020 15:12:11 +0000
Subject: [PATCH] GCC: fix template specialization in WTF::VectorBuffer

GCC complains that explicit specialization in non-namespace scope
is happening for InitInlinedBuffer. However, specialization is
not really necessary here with templates and can be moved
into InitInlinedBuffer method without changing generated code.

Bug: 819294
Change-Id: Ia8060152bf4ba21c85dfc4d99cd7cc64983de077
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2179122
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#774141}
---
 third_party/blink/renderer/platform/wtf/vector.h | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/third_party/blink/renderer/platform/wtf/vector.h b/third_party/blink/renderer/platform/wtf/vector.h
index 267eb905013b..d75f348550db 100644
--- a/third_party/blink/renderer/platform/wtf/vector.h
+++ b/third_party/blink/renderer/platform/wtf/vector.h
@@ -950,11 +950,10 @@ class VectorBuffer : protected VectorBufferBase<T, Allocator> {
     return unsafe_reinterpret_cast_ptr<const T*>(inline_buffer_);
   }
 
-  template <bool = Allocator::kIsGarbageCollected>
-  void InitInlinedBuffer() {}
-  template <>
-  void InitInlinedBuffer<true>() {
-    memset(&inline_buffer_, 0, kInlineBufferSize);
+  void InitInlinedBuffer() {
+    if (Allocator::kIsGarbageCollected) {
+      memset(&inline_buffer_, 0, kInlineBufferSize);
+    }
   }
 
   alignas(T) char inline_buffer_[kInlineBufferSize];
-- 
2.26.2