aboutsummaryrefslogtreecommitdiffstats
path: root/community/chromium/chromium-71-gcc-0.patch
blob: 8ffadff20bc995c4664a7a72184e9b90c890c4ce (plain)
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From 65be571f6ac2f7942b4df9e50b24da517f829eec Mon Sep 17 00:00:00 2001
From: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com>
Date: Mon, 15 Oct 2018 20:26:10 +0000
Subject: [PATCH] google_util: Explicitly use std::initializer_list with
 base::NoDestructor
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Follow-up to ac53c5c53 ("Remove CR_DEFINE_STATIC_LOCAL from /components").
Due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84849, having
base::NoDestructor<T<U>> and passing an initializer list of Us does not
work if this is not done explicitly, as GCC incorrectly fails to determine
which constructor overload to use:

    ../../components/google/core/common/google_util.cc: In function ‘bool google_util::{anonymous}::IsCanonicalHostGoogleHostname(base::StringPiece, google_util::SubdomainPermission)’:
    ../../components/google/core/common/google_util.cc:120:24: error: call of overloaded ‘NoDestructor(<brace-enclosed initializer list>)’ is ambiguous
           {GOOGLE_TLD_LIST});

See also: https://chromium-review.googlesource.com/c/chromium/src/+/1170905

Bug: 819294
Change-Id: Ie1490b6646d7998d636c485769caabf56c1cf44c
Reviewed-on: https://chromium-review.googlesource.com/c/1275854
Reviewed-by: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Raphael Kubo da Costa (CET) <raphael.kubo.da.costa@intel.com>
Cr-Commit-Position: refs/heads/master@{#599733}
---
 components/google/core/common/google_util.cc | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/components/google/core/common/google_util.cc b/components/google/core/common/google_util.cc
index a44c84393820..7733848a0443 100644
--- components/google/core/common/google_util.cc
+++ components/google/core/common/google_util.cc
@@ -117,7 +117,7 @@ bool IsCanonicalHostGoogleHostname(base::StringPiece canonical_host,
   StripTrailingDot(&tld);
 
   static base::NoDestructor<std::set<std::string>> google_tlds(
-      {GOOGLE_TLD_LIST});
+      std::initializer_list<std::string>({GOOGLE_TLD_LIST}));
   return base::ContainsKey(*google_tlds, tld.as_string());
 }
 
@@ -132,7 +132,8 @@ bool IsGoogleSearchSubdomainUrl(const GURL& url) {
   StripTrailingDot(&host);
 
   static base::NoDestructor<std::set<std::string>> google_subdomains(
-      {"ipv4.google.com", "ipv6.google.com"});
+      std::initializer_list<std::string>(
+          {"ipv4.google.com", "ipv6.google.com"}));
 
   return base::ContainsKey(*google_subdomains, host.as_string());
 }
-- 
2.19.1