Skip to content

Commit f1dd312

Browse files
committed
✅ fix test
1 parent aebca2e commit f1dd312

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

tests/src/unit-regression2.cpp

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,32 @@ struct for_3171_base // NOLINT(cppcoreguidelines-special-member-functions)
235235
for_3171_base(const std::string& /*unused*/ = {}) {}
236236
virtual ~for_3171_base();
237237

238+
for_3171_base(const for_3171_base& other) // NOLINT(hicpp-use-equals-default,modernize-use-equals-default)
239+
: str(other.str)
240+
{}
241+
242+
for_3171_base& operator=(const for_3171_base& other)
243+
{
244+
if (this != &other)
245+
{
246+
str = other.str;
247+
}
248+
return *this;
249+
}
250+
251+
for_3171_base(for_3171_base&& other) noexcept
252+
: str(std::move(other.str))
253+
{}
254+
255+
for_3171_base& operator=(for_3171_base&& other) noexcept
256+
{
257+
if (this != &other)
258+
{
259+
str = std::move(other.str);
260+
}
261+
return *this;
262+
}
263+
238264
virtual void _from_json(const json& j)
239265
{
240266
j.at("str").get_to(str);
@@ -251,7 +277,7 @@ struct for_3171_derived : public for_3171_base
251277
~for_3171_derived() override;
252278
explicit for_3171_derived(const std::string& /*unused*/) { }
253279

254-
for_3171_derived(const for_3171_derived& other)
280+
for_3171_derived(const for_3171_derived& other) // NOLINT(hicpp-use-equals-default,modernize-use-equals-default)
255281
: for_3171_base(other)
256282
{}
257283

0 commit comments

Comments
 (0)