summaryrefslogtreecommitdiff
path: root/Tests
diff options
context:
space:
mode:
authorDaniel Bertalan <dani@danielbertalan.dev>2023-05-01 16:59:46 +0200
committerTim Flynn <trflynn89@pm.me>2023-05-02 07:03:57 -0400
commit00b4976f2cd5b26e557ed4f5995bc64f64f2e664 (patch)
treeff6eac0ea2c6d9156cbf38ba63f1849fd6c01fdd /Tests
parent1422f7f90423b8aa5d326c0ca355d8911df9f2bf (diff)
downloadserenity-00b4976f2cd5b26e557ed4f5995bc64f64f2e664.zip
Everywhere: Make Lagom build with GCC 13
GCC 13 was released on 2023-04-26. This commit fixes Lagom build errors when using an updated host toolchain: - Adds a workaround for a bug in constraint handling, which made LibJS fail to compile: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109683 - Silences the new `-Wdangling-reference` diagnostic globally. It produces multiple false positives with no clear way to silence them without `#pragmas`. - Silences `-Wself-move` in `RefPtr` tests as GCC 13 adds this previously Clang-exclusive warning.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/AK/TestRefPtr.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/Tests/AK/TestRefPtr.cpp b/Tests/AK/TestRefPtr.cpp
index ceac8e06ff..20c3e10bec 100644
--- a/Tests/AK/TestRefPtr.cpp
+++ b/Tests/AK/TestRefPtr.cpp
@@ -97,14 +97,11 @@ TEST_CASE(assign_moved_self)
{
RefPtr<Object> object = adopt_ref(*new Object);
EXPECT_EQ(object->ref_count(), 1u);
-#if defined(AK_COMPILER_CLANG)
-# pragma clang diagnostic push
-# pragma clang diagnostic ignored "-Wself-move"
-#endif
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wpragmas"
+#pragma GCC diagnostic ignored "-Wself-move"
object = move(object);
-#if defined(AK_COMPILER_CLANG)
-# pragma clang diagnostic pop
-#endif
+#pragma GCC diagnostic pop
EXPECT_EQ(object->ref_count(), 1u);
}