Index: include/__config =================================================================== --- include/__config +++ include/__config @@ -849,9 +849,11 @@ _LIBCPP_ALWAYS_INLINE explicit x(int __v) : __v_(static_cast<__lx>(__v)) {} \ _LIBCPP_ALWAYS_INLINE operator int() const {return __v_;} \ }; +#define _LIBCPP_UNDERLYING_ENUM_TYPE(t) #else // _LIBCPP_HAS_NO_STRONG_ENUMS #define _LIBCPP_DECLARE_STRONG_ENUM(x) enum class _LIBCPP_ENUM_VIS x #define _LIBCPP_DECLARE_STRONG_ENUM_EPILOG(x) +#define _LIBCPP_UNDERLYING_ENUM_TYPE(t) : t #endif // _LIBCPP_HAS_NO_STRONG_ENUMS #ifdef _LIBCPP_DEBUG Index: include/string =================================================================== --- include/string +++ include/string @@ -680,7 +680,7 @@ enum {__long_mask = 0x1ul}; #else // _LIBCPP_BIG_ENDIAN enum {__short_mask = 0x80}; - enum {__long_mask = ~(size_type(~0) >> 1)}; + enum _LIBCPP_UNDERLYING_ENUM_TYPE(size_type) {__long_mask = ~(size_type(~0) >> 1)}; #endif // _LIBCPP_BIG_ENDIAN enum {__min_cap = (sizeof(__long) - 1)/sizeof(value_type) > 2 ? @@ -707,7 +707,7 @@ #if _LIBCPP_BIG_ENDIAN enum {__short_mask = 0x80}; - enum {__long_mask = ~(size_type(~0) >> 1)}; + enum _LIBCPP_UNDERLYING_ENUM_TYPE(size_type) {__long_mask = ~(size_type(~0) >> 1)}; #else // _LIBCPP_BIG_ENDIAN enum {__short_mask = 0x01}; enum {__long_mask = 0x1ul};