Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb84dee1

Browse files
Solving the following compile time error
error: moving ‘a’ of type ‘arduino::String’ to itself [-Werror=self-move]
1 parent2aaef7b commitb84dee1

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

‎test/src/String/test_move.cpp‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,10 @@ TEST_CASE("Testing String move assignment", "[String-move-02]")
3737

3838
TEST_CASE("Testing String move self assignment","[String-move-03]")
3939
{
40-
#if (defined(GCC_VERSION) && GCC_VERSION >= 13) || (defined(__clang_major__) && __clang_major__ >= 14)
41-
#pragma GCC diagnostic push
42-
#pragma GCC diagnostic ignored "-Wself-move"
43-
#endif
44-
arduino::Stringa("src");
45-
a =std::move(a);
46-
REQUIRE(a =="src");
47-
#if defined(GCC_VERSION) && GCC_VERSION >= 13
48-
#pragma GCC diagnostic pop
49-
#endif
40+
String b;
41+
{
42+
arduino::Stringa("src");
43+
b =std::move(a);
44+
}
45+
REQUIRE(b =="src");
5046
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp