diff --git a/AK/StdLibExtras.h b/AK/StdLibExtras.h index c47066df4a..e8e02703ee 100644 --- a/AK/StdLibExtras.h +++ b/AK/StdLibExtras.h @@ -504,6 +504,9 @@ using CopyConst = template using Void = void; +template +inline constexpr auto DependentFalse = false; + } using AK::AddConst; @@ -512,6 +515,7 @@ using AK::ceil_div; using AK::clamp; using AK::Conditional; using AK::declval; +using AK::DependentFalse; using AK::exchange; using AK::forward; using AK::is_trivial; diff --git a/Libraries/LibIPC/Decoder.h b/Libraries/LibIPC/Decoder.h index 1f366f5d3f..37c3d6a848 100644 --- a/Libraries/LibIPC/Decoder.h +++ b/Libraries/LibIPC/Decoder.h @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -37,8 +38,8 @@ namespace IPC { template inline bool decode(Decoder&, T&) { + static_assert(DependentFalse, "Base IPC::decoder() instantiated"); ASSERT_NOT_REACHED(); - return false; } class Decoder { diff --git a/Libraries/LibIPC/Encoder.h b/Libraries/LibIPC/Encoder.h index da88d889ac..b5869c5a82 100644 --- a/Libraries/LibIPC/Encoder.h +++ b/Libraries/LibIPC/Encoder.h @@ -34,6 +34,7 @@ namespace IPC { template bool encode(Encoder&, T&) { + static_assert(DependentFalse, "Base IPC::encode() was instantiated"); ASSERT_NOT_REACHED(); }