From f699e91fe53870b6a7f0e9fe61cc92fc44b1033b Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Thu, 24 Jan 2019 15:13:07 +0100 Subject: [PATCH] mem-cache: Assert Entry inherits from QueueEntry in Queue Queue has several assumptions regarding its template parameter, so make sure they are fulfilled by forcing Entry to be derived from QueueEntry. Change-Id: I0203a62aec00c04ac89e9674d86a44a07f9f13ab Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17529 Tested-by: kokoro Reviewed-by: Nikos Nikoleris Maintainer: Nikos Nikoleris --- src/mem/cache/queue.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mem/cache/queue.hh b/src/mem/cache/queue.hh index 36ddb96c2..6c8a19265 100644 --- a/src/mem/cache/queue.hh +++ b/src/mem/cache/queue.hh @@ -51,6 +51,7 @@ #include #include +#include #include "base/logging.hh" #include "base/trace.hh" @@ -68,6 +69,9 @@ template class Queue : public Drainable { + static_assert(std::is_base_of::value, + "Entry must be derived from QueueEntry"); + protected: /** Local label (for functional print requests) */ const std::string label; -- 2.30.2