#include <cstdint> enum Enum : uint8_t {}; Enum foo(int NewValue) { return Enum(NewValue); } The construction of an enum with a wider type should add a narrowing conversion warning.