Index: gdb/common/enum-flags.h
--- gdb/common/enum-flags.h.orig
+++ gdb/common/enum-flags.h
@@ -82,7 +82,7 @@ template<typename T>
 struct enum_underlying_type
 {
   typedef typename
-    integer_for_size<sizeof (T), static_cast<bool>(T (-1) < T (0))>::type
+    integer_for_size<sizeof (T), (std::numeric_limits<T>::lowest() < 0)>::type
     type;
 };
 
