From b76ad3db90a4c6ae21ca2ed0f70ca9c773394dd3 Mon Sep 17 00:00:00 2001 From: Daniel Bertalan Date: Mon, 5 Jul 2021 19:00:43 +0200 Subject: [PATCH] IPCCompiler+WindowServer: Fix deleted function warning It might be the case that we are passing non-movable/non-copyable things through IPC. In this case, Clang will emit a warning as it can't generate the requested default move/copy ctor for the IPC message. To fix this, we use a `#pragma` to make the compiler silently ignore our request. The same was the case with the three-way comparison in `Screen`. Since we don't use the three-way comparison operator anywhere else in our codebase, we simply use the `==` operator instead. --- Userland/DevTools/IPCCompiler/main.cpp | 9 +++++++++ Userland/Services/WindowServer/ScreenLayout.h | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Userland/DevTools/IPCCompiler/main.cpp b/Userland/DevTools/IPCCompiler/main.cpp index 654e9fd2a2..2411154741 100644 --- a/Userland/DevTools/IPCCompiler/main.cpp +++ b/Userland/DevTools/IPCCompiler/main.cpp @@ -284,6 +284,11 @@ int main(int argc, char** argv) #include #include #include + +#ifdef __clang__ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdefaulted-function-deleted" +#endif )~~~"); for (auto& endpoint : endpoints) { @@ -865,6 +870,10 @@ public: endpoint_generator.append(R"~~~( private: }; + +#ifdef __clang__ +#pragma clang diagnostic pop +#endif )~~~"); } diff --git a/Userland/Services/WindowServer/ScreenLayout.h b/Userland/Services/WindowServer/ScreenLayout.h index a2a44299c0..c467ba9f42 100644 --- a/Userland/Services/WindowServer/ScreenLayout.h +++ b/Userland/Services/WindowServer/ScreenLayout.h @@ -28,7 +28,7 @@ public: return { location, { resolution.width() / scale_factor, resolution.height() / scale_factor } }; } - auto operator<=>(const Screen&) const = default; + bool operator==(const Screen&) const = default; }; Vector screens;