aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/common/UniqueTrackablePtr.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/common/UniqueTrackablePtr.cpp b/tests/common/UniqueTrackablePtr.cpp
index 3ab4cee1a55..a6de1d68ce7 100644
--- a/tests/common/UniqueTrackablePtr.cpp
+++ b/tests/common/UniqueTrackablePtr.cpp
@@ -17,6 +17,7 @@
#include "tc_catch2.h"
+#include "CompilerDefs.h"
#include "UniqueTrackablePtr.h"
struct TestObj
@@ -104,6 +105,12 @@ TEST_CASE("Trinity::unique_weak_ptr", "[UniqueTrackablePtr]")
}
}
+// disable warning about invalid reinterpret_cast, test intentionally tests this
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wreinterpret-base-class"
+#endif
+
TEST_CASE("Trinity::unique_strong_ref_ptr type casts", "[UniqueTrackablePtr]")
{
Trinity::unique_trackable_ptr<TestObj> ptr = Trinity::make_unique_trackable<TestObj3>();
@@ -152,3 +159,7 @@ TEST_CASE("Trinity::unique_strong_ref_ptr type casts", "[UniqueTrackablePtr]")
REQUIRE(testObj2 == Trinity::dynamic_pointer_cast<TestObj4>(weak).lock());
}
}
+
+#if TRINITY_COMPILER == TRINITY_COMPILER_GNU
+#pragma GCC diagnostic pop
+#endif