You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the NAMEOF_ENUM_RANGE_MIN and NAMEOF_ENUM_RANGE_MAX set to [0, N] an enum like the following seems to produce an incorrect warning message.
#include<cstdint>enum Test : uint32_t
{
First = 0,
Last = 0xFFFFFFFF,
};
[build] ../../tests/nameof.hpp:526:21: error: static assertion failed: nameof::enum_range detects enum value smaller than min range size.
[build] 526 | static_assert(!is_valid<E, value<E, lhs - 1, IsFlags>(0)>(), "nameof::enum_range detects enum value smaller than min range size.");
I would expect the warning to be something line "enum larger than the max range size"
The text was updated successfully, but these errors were encountered:
Reproduced it with a smaller enum of size uint8_t with NAMEOF_ENUM_RANGE_MIN 0 and NAMEOF_ENUM_RANGE_MAX 4096. It seems to not like when the first bit is a 1. Some problem with the signedness. This should be a valid use case
enum Test : uint8_t
{
First = 0,
//...
Last = 0xFF,
}
With the NAMEOF_ENUM_RANGE_MIN and NAMEOF_ENUM_RANGE_MAX set to [0, N] an enum like the following seems to produce an incorrect warning message.
I would expect the warning to be something line "enum larger than the max range size"
The text was updated successfully, but these errors were encountered: