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 <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17529
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
This commit is contained in:
Daniel R. Carvalho
2019-01-24 15:13:07 +01:00
committed by Daniel Carvalho
parent 5fabb992ff
commit f699e91fe5

View File

@@ -51,6 +51,7 @@
#include <cassert>
#include <string>
#include <type_traits>
#include "base/logging.hh"
#include "base/trace.hh"
@@ -68,6 +69,9 @@
template<class Entry>
class Queue : public Drainable
{
static_assert(std::is_base_of<QueueEntry, Entry>::value,
"Entry must be derived from QueueEntry");
protected:
/** Local label (for functional print requests) */
const std::string label;