Skip to content

Commit feb8333

Browse files
committed
build: try to suppress an annoying false warning from gcc
1 parent d080b74 commit feb8333

3 files changed

Lines changed: 42 additions & 1 deletion

File tree

TODO

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ TODO:
1313
* work stealing job system (see #100) + mt scheduler based on const awareness for types
1414
* combine version-mask-vs-version-bits tricks with reserved bits to allow things like enabling/disabling
1515
* auto type info data from types if present
16-
* suppress -Wself-move on CI with g++13
1716
* built-in no-pagination storage - no_pagination page size as limits::max
1817
* any cdynamic to support const ownership construction
1918
* meta non-const allow_cast overloads: (const int &) to (int &) is not allowed, but (const int &) to (double &) is allowed (support only for convertibles)

test/entt/core/any.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ TEST_F(Any, SBOMoveAssignment) {
322322
ASSERT_EQ(entt::any_cast<int>(other), 2);
323323
}
324324

325+
#if defined(__GNUC__)
326+
# pragma GCC diagnostic push
327+
# pragma GCC diagnostic ignored "-Wself-move"
328+
#endif
325329
TEST_F(Any, SBOSelfMoveAssignment) {
326330
entt::any any{2};
327331

@@ -334,6 +338,9 @@ TEST_F(Any, SBOSelfMoveAssignment) {
334338
ASSERT_EQ(any.info(), entt::type_id<int>());
335339
ASSERT_EQ(entt::any_cast<int>(any), 2);
336340
}
341+
#if defined(__GNUC__)
342+
# pragma GCC diagnostic pop
343+
#endif
337344

338345
TEST_F(Any, SBODirectAssignment) {
339346
entt::any any{};
@@ -647,6 +654,10 @@ TEST_F(Any, NoSBOMoveAssignment) {
647654
ASSERT_EQ(entt::any_cast<fat>(other), instance);
648655
}
649656

657+
#if defined(__GNUC__)
658+
# pragma GCC diagnostic push
659+
# pragma GCC diagnostic ignored "-Wself-move"
660+
#endif
650661
TEST_F(Any, NoSBOSelfMoveAssignment) {
651662
const fat instance{.1, .2, .3, .4};
652663
entt::any any{instance};
@@ -660,6 +671,9 @@ TEST_F(Any, NoSBOSelfMoveAssignment) {
660671
ASSERT_EQ(any.info(), entt::type_id<fat>());
661672
ASSERT_EQ(entt::any_cast<fat>(any), instance);
662673
}
674+
#if defined(__GNUC__)
675+
# pragma GCC diagnostic pop
676+
#endif
663677

664678
TEST_F(Any, NoSBODirectAssignment) {
665679
const fat instance{.1, .2, .3, .4};
@@ -861,6 +875,10 @@ TEST_F(Any, VoidMoveAssignment) {
861875
ASSERT_EQ(entt::any_cast<double>(&other), nullptr);
862876
}
863877

878+
#if defined(__GNUC__)
879+
# pragma GCC diagnostic push
880+
# pragma GCC diagnostic ignored "-Wself-move"
881+
#endif
864882
TEST_F(Any, VoidSelfMoveAssignment) {
865883
entt::any any{std::in_place_type<void>};
866884

@@ -873,6 +891,9 @@ TEST_F(Any, VoidSelfMoveAssignment) {
873891
ASSERT_EQ(any.info(), entt::type_id<void>());
874892
ASSERT_EQ(any.data(), nullptr);
875893
}
894+
#if defined(__GNUC__)
895+
# pragma GCC diagnostic pop
896+
#endif
876897

877898
TEST_F(Any, SBOMoveValidButUnspecifiedState) {
878899
entt::any any{2};

test/entt/meta/meta_any.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,10 @@ TEST_F(MetaAny, SBOMoveAssignment) {
410410
ASSERT_NE(other, entt::meta_any{0});
411411
}
412412

413+
#if defined(__GNUC__)
414+
# pragma GCC diagnostic push
415+
# pragma GCC diagnostic ignored "-Wself-move"
416+
#endif
413417
TEST_F(MetaAny, SBOSelfMoveAssignment) {
414418
entt::meta_any any{3};
415419

@@ -422,6 +426,9 @@ TEST_F(MetaAny, SBOSelfMoveAssignment) {
422426
ASSERT_EQ(any, entt::meta_any{3});
423427
ASSERT_NE(any, entt::meta_any{0});
424428
}
429+
#if defined(__GNUC__)
430+
# pragma GCC diagnostic pop
431+
#endif
425432

426433
TEST_F(MetaAny, SBODirectAssignment) {
427434
entt::meta_any any{};
@@ -746,6 +753,10 @@ TEST_F(MetaAny, NoSBOMoveAssignment) {
746753
ASSERT_NE(other, fat{});
747754
}
748755

756+
#if defined(__GNUC__)
757+
# pragma GCC diagnostic push
758+
# pragma GCC diagnostic ignored "-Wself-move"
759+
#endif
749760
TEST_F(MetaAny, NoSBOSelfMoveAssignment) {
750761
const fat instance{.1, .2, .3, .4};
751762
entt::meta_any any{instance};
@@ -759,6 +770,9 @@ TEST_F(MetaAny, NoSBOSelfMoveAssignment) {
759770
ASSERT_EQ(any, entt::meta_any{instance});
760771
ASSERT_NE(any, fat{});
761772
}
773+
#if defined(__GNUC__)
774+
# pragma GCC diagnostic pop
775+
#endif
762776

763777
TEST_F(MetaAny, NoSBODirectAssignment) {
764778
const fat instance{.1, .2, .3, .4};
@@ -1004,6 +1018,10 @@ TEST_F(MetaAny, VoidMoveAssignment) {
10041018
ASSERT_EQ(other, entt::meta_any{std::in_place_type<void>});
10051019
}
10061020

1021+
#if defined(__GNUC__)
1022+
# pragma GCC diagnostic push
1023+
# pragma GCC diagnostic ignored "-Wself-move"
1024+
#endif
10071025
TEST_F(MetaAny, VoidSelfMoveAssignment) {
10081026
entt::meta_any any{std::in_place_type<void>};
10091027

@@ -1015,6 +1033,9 @@ TEST_F(MetaAny, VoidSelfMoveAssignment) {
10151033
ASSERT_EQ(any.type(), entt::resolve<void>());
10161034
ASSERT_EQ(any, entt::meta_any{std::in_place_type<void>});
10171035
}
1036+
#if defined(__GNUC__)
1037+
# pragma GCC diagnostic pop
1038+
#endif
10181039

10191040
TEST_F(MetaAny, SBOMoveInvalidate) {
10201041
entt::meta_any any{3};

0 commit comments

Comments
 (0)