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.
This commit is contained in:
parent
f14a4994b0
commit
b76ad3db90
Notes:
sideshowbarker
2024-07-18 10:06:12 +09:00
Author: https://github.com/BertalanD Commit: https://github.com/SerenityOS/serenity/commit/b76ad3db90a Pull-request: https://github.com/SerenityOS/serenity/pull/8470 Reviewed-by: https://github.com/Dexesttp Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/alimpfard Reviewed-by: https://github.com/gunnarbeutner ✅
2 changed files with 10 additions and 1 deletions
|
@ -284,6 +284,11 @@ int main(int argc, char** argv)
|
|||
#include <LibIPC/File.h>
|
||||
#include <LibIPC/Message.h>
|
||||
#include <LibIPC/Stub.h>
|
||||
|
||||
#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
|
||||
)~~~");
|
||||
}
|
||||
|
||||
|
|
|
@ -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<Screen> screens;
|
||||
|
|
Loading…
Add table
Reference in a new issue