-
Notifications
You must be signed in to change notification settings - Fork 7
/
chromium-73-gcc-1.patch
99 lines (83 loc) · 4.1 KB
/
chromium-73-gcc-1.patch
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
From 130a5ae24a02daba8729ba2216bcaf3dbfacea69 Mon Sep 17 00:00:00 2001
From: Raphael Kubo da Costa <[email protected]>
Date: Fri, 8 Feb 2019 16:58:38 +0000
Subject: [PATCH] media::learning: Make LabelledExample's move assignment
operator noexcept
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
The GCC build is currently broken with an error like this:
../../media/learning/common/labelled_example.cc:20:1: error: function ‘media::learning::LabelledExample::LabelledExample(media::learning::LabelledExample&&)’ defaulted on its redeclaration with an exception-specification that differs from the implicit exception-specification ‘’
LabelledExample::LabelledExample(LabelledExample&& rhs) noexcept = default;
^~~~~~~~~~~~~~~
With GCC, having that noexcept marker requires all members to be marked with
noexcept themselves, and TargetValue was missing some assignment operators
and noexcept markers.
clang is fine because we pass -fno-exceptions and it disables the same error
there, while GCC continues to raise it (bug 843143 and its corresponding CL
have a longer discussion on this issue).
Bug: 819294
Change-Id: Ide30932fc466ccb52d6883a82777e703dae48798
Reviewed-on: https://chromium-review.googlesource.com/c/1458210
Commit-Queue: Frank Liberato <[email protected]>
Reviewed-by: Frank Liberato <[email protected]>
Auto-Submit: Raphael Kubo da Costa <[email protected]>
Cr-Commit-Position: refs/heads/master@{#630355}
---
media/learning/common/labelled_example.cc | 3 ++-
media/learning/common/labelled_example.h | 2 +-
media/learning/common/value.cc | 6 ++++++
media/learning/common/value.h | 4 ++++
4 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/media/learning/common/labelled_example.cc b/media/learning/common/labelled_example.cc
index 76d08509298e..43e834f9f3cf 100644
--- a/media/learning/common/labelled_example.cc
+++ b/media/learning/common/labelled_example.cc
@@ -59,7 +59,8 @@ bool LabelledExample::operator<(const LabelledExample& rhs) const {
LabelledExample& LabelledExample::operator=(const LabelledExample& rhs) =
default;
-LabelledExample& LabelledExample::operator=(LabelledExample&& rhs) = default;
+LabelledExample& LabelledExample::operator=(LabelledExample&& rhs) noexcept =
+ default;
TrainingData::TrainingData() = default;
diff --git a/media/learning/common/labelled_example.h b/media/learning/common/labelled_example.h
index 4f43c54e7a76..365abc3c0ebf 100644
--- a/media/learning/common/labelled_example.h
+++ b/media/learning/common/labelled_example.h
@@ -40,7 +40,7 @@ struct COMPONENT_EXPORT(LEARNING_COMMON) LabelledExample {
bool operator<(const LabelledExample& rhs) const;
LabelledExample& operator=(const LabelledExample& rhs);
- LabelledExample& operator=(LabelledExample&& rhs);
+ LabelledExample& operator=(LabelledExample&& rhs) noexcept;
// Observed feature values.
// Note that to interpret these values, you probably need to have the
diff --git a/media/learning/common/value.cc b/media/learning/common/value.cc
index 9c9395c25d4e..12ea399d24c3 100644
--- a/media/learning/common/value.cc
+++ b/media/learning/common/value.cc
@@ -23,6 +23,12 @@ Value::Value(const std::string& x) : value_(base::PersistentHash(x)) {}
Value::Value(const Value& other) : value_(other.value_) {}
+Value::Value(Value&& rhs) noexcept = default;
+
+Value& Value::operator=(const Value& rhs) = default;
+
+Value& Value::operator=(Value&& rhs) noexcept = default;
+
bool Value::operator==(const Value& rhs) const {
return value_ == rhs.value_;
}
diff --git a/media/learning/common/value.h b/media/learning/common/value.h
index 0e64da961f34..62f4953f691c 100644
--- a/media/learning/common/value.h
+++ b/media/learning/common/value.h
@@ -38,6 +38,10 @@ class COMPONENT_EXPORT(LEARNING_COMMON) Value {
explicit Value(const std::string& x);
Value(const Value& other);
+ Value(Value&&) noexcept;
+
+ Value& operator=(const Value&);
+ Value& operator=(Value&&) noexcept;
bool operator==(const Value& rhs) const;
bool operator!=(const Value& rhs) const;
--
2.20.1