diff --git a/Libraries/LibCore/CEventLoop.cpp b/Libraries/LibCore/CEventLoop.cpp index 8019c1378af..ce983847a40 100644 --- a/Libraries/LibCore/CEventLoop.cpp +++ b/Libraries/LibCore/CEventLoop.cpp @@ -241,8 +241,9 @@ void CEventLoop::pump(WaitMode mode) for (int i = 0; i < events.size(); ++i) { auto& queued_event = events.at(i); +#ifndef __clang__ ASSERT(queued_event.event); - +#endif auto* receiver = queued_event.receiver.ptr(); auto& event = *queued_event.event; #ifdef CEVENTLOOP_DEBUG diff --git a/Libraries/LibCore/CIODevice.h b/Libraries/LibCore/CIODevice.h index e57c6508992..17754dfa8a4 100644 --- a/Libraries/LibCore/CIODevice.h +++ b/Libraries/LibCore/CIODevice.h @@ -5,7 +5,7 @@ #include class CIODevice : public CObject { - C_OBJECT(CIODevice) + C_OBJECT_ABSTRACT(CIODevice) public: enum OpenMode { NotOpen = 0, diff --git a/Libraries/LibCore/CObject.h b/Libraries/LibCore/CObject.h index 709d2e607e3..b9c88282498 100644 --- a/Libraries/LibCore/CObject.h +++ b/Libraries/LibCore/CObject.h @@ -26,6 +26,10 @@ public: \ { \ return adopt(*new klass(forward(args)...)); \ } + +#define C_OBJECT_ABSTRACT(klass) \ +public: \ + virtual const char* class_name() const override { return #klass; } class CObject : public RefCounted