Skip to content

Commit f0f4314

Browse files
authored
style(clang-tidy): Fix cppcoreguidelines-noexcept-move-operations errors (#1744)
fixes #1666 Signed-off-by: Balakrishna Avulapati <ba@bavulapati.com>
1 parent 264dc25 commit f0f4314

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/core/json/include/sourcemeta/core/json_value.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,9 +216,9 @@ class SOURCEMETA_CORE_JSON_EXPORT JSON {
216216

217217
/// Misc constructors
218218
JSON(const JSON &);
219-
JSON(JSON &&);
219+
JSON(JSON &&) noexcept;
220220
auto operator=(const JSON &) -> JSON &;
221-
auto operator=(JSON &&) -> JSON &;
221+
auto operator=(JSON &&) noexcept -> JSON &;
222222

223223
/// Destructor
224224
~JSON();

src/core/json/json_value.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ JSON::JSON(const JSON &other) : current_type{other.current_type} {
117117
}
118118
}
119119

120-
JSON::JSON(JSON &&other) : current_type{other.current_type} {
120+
JSON::JSON(JSON &&other) noexcept : current_type{other.current_type} {
121121
switch (other.current_type) {
122122
case Type::Boolean:
123123
this->data_boolean = other.data_boolean;
@@ -174,7 +174,7 @@ auto JSON::operator=(const JSON &other) -> JSON & {
174174
return *this;
175175
}
176176

177-
auto JSON::operator=(JSON &&other) -> JSON & {
177+
auto JSON::operator=(JSON &&other) noexcept -> JSON & {
178178
this->maybe_destruct_union();
179179
this->current_type = other.current_type;
180180
switch (other.current_type) {

0 commit comments

Comments
 (0)