http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59027

--- Comment #4 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
(In reply to Marc Mutz from comment #3)
> See code posted in http://llvm.org/bugs/show_bug.cgi?id=17834
> is_unsigned<MouseButton> fails, !is_signed succeeds. MouseButton is an enum.

The assertion of the following code is required to hold according to the C++
library specification:

//---------------
#include <type_traits>

enum MouseButton {};

static_assert(!std::is_signed<MouseButton>::value, "");
//---------------

MouseButton is no arithmetic type therefore std::is_signed is required to
return false. If you are interested in the sign character of either the
underlying type or the promoted type of MouseButton, you have to perform
different tests, such as

static_assert(!std::is_signed<std::underlying_type<MouseButton>::type>::value,
"");
static_assert(std::is_signed<decltype(+MouseButton())>::value, "");

(The first result is currently unspecified by the standard)

Reply via email to