From: Daniel R. Carvalho Date: Sat, 26 Dec 2020 00:52:00 +0000 (-0300) Subject: base: Assert Flags' type is unsigned X-Git-Tag: develop-gem5-snapshot~303 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4a503306a718bc8bd2098addf066ff5e3965061f;p=gem5.git 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 --- 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: