[cfe-dev] Motivation for scoped enum comparison behavior?

Justin Bogner mail at justinbogner.com
Tue Oct 22 13:46:00 PDT 2013


Eric Fiselier <eric at efcs.ca> writes:
> I wanted to ask why clang chooses to compare scoped enumerators as if they
> were unsigned numbers, even when the underlying type is signed. For example
>
> enum class E : int
> {
>    neg_one = -1,
>    one = 1;
> };
>
> neg_one > one; // true

What version of clang are you using? I don't see the behaviour you're
seeing.



More information about the cfe-dev mailing list