From 4a503306a718bc8bd2098addf066ff5e3965061f Mon Sep 17 00:00:00 2001 From: "Daniel R. Carvalho" Date: Fri, 25 Dec 2020 21:52:00 -0300 Subject: [PATCH] base: Assert Flags' type is unsigned Operations rely on the use of unsigned integers. Change-Id: I825a88f81b54577585976d6558b1409870897721 Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38712 Reviewed-by: Jason Lowe-Power Maintainer: Bobby R. Bruce Tested-by: kokoro --- src/base/flags.hh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/base/flags.hh b/src/base/flags.hh index c9525fae2..505a1e54f 100644 --- a/src/base/flags.hh +++ b/src/base/flags.hh @@ -29,10 +29,14 @@ #ifndef __BASE_FLAGS_HH__ #define __BASE_FLAGS_HH__ +#include + template class Flags { private: + static_assert(std::is_unsigned::value, "Flag type must be unsigned"); + T _flags; public: -- 2.30.2