chromium/chromium-76.0.3809.100-gcc-accountinfo-move-noexcept.patch

54 lines
1.9 KiB
Diff
Raw Normal View History

From 719df31ffd4d52b473509cf77acd9c02ec112acb Mon Sep 17 00:00:00 2001
From: Jose Dapena Paz <jose.dapena@lge.com>
Date: Tue, 04 Jun 2019 18:38:12 +0200
Subject: [PATCH] GCC: fix noexcept from move constructor and assign operators of AccountInfo
AccountInfo declares them as noexcept and uses default implementation,
so all its members (including AccountId) should be noexcept. But AccountId
is not noexcept. To fix it we just need to make CoreAccountId move
operator/assign operator noexcept.
Bug: 819294
Change-Id: Ice38654ab7cf3b9eaa6f54aa36e1fec329264f98
---
diff --git a/google_apis/gaia/core_account_id.cc b/google_apis/gaia/core_account_id.cc
index d808082..12eefe3 100644
--- a/google_apis/gaia/core_account_id.cc
+++ b/google_apis/gaia/core_account_id.cc
@@ -6,8 +6,16 @@
CoreAccountId::CoreAccountId() = default;
+CoreAccountId::CoreAccountId(const CoreAccountId&) = default;
+
+CoreAccountId::CoreAccountId(CoreAccountId&&) noexcept = default;
+
CoreAccountId::~CoreAccountId() = default;
+CoreAccountId& CoreAccountId::operator=(const CoreAccountId&) = default;
+
+CoreAccountId& CoreAccountId::operator=(CoreAccountId&&) noexcept = default;
+
CoreAccountId::CoreAccountId(const char* id) : id(id) {}
CoreAccountId::CoreAccountId(std::string&& id) : id(std::move(id)) {}
diff --git a/google_apis/gaia/core_account_id.h b/google_apis/gaia/core_account_id.h
index 5ea602a..c2d1911 100644
--- a/google_apis/gaia/core_account_id.h
+++ b/google_apis/gaia/core_account_id.h
@@ -14,8 +14,13 @@
// for design and tracking).
struct CoreAccountId {
CoreAccountId();
+ CoreAccountId(const CoreAccountId&);
+ CoreAccountId(CoreAccountId&&) noexcept;
~CoreAccountId();
+ CoreAccountId& operator=(const CoreAccountId&);
+ CoreAccountId& operator=(CoreAccountId&&) noexcept;
+
// Those implicit constructor and conversion operator allow to
// progressively migrate the code to use this struct. Removing
// them is tracked by https://crbug.com/959161