2 // { dg-do compile { target c++11 } }
4 template <unsigned int, bool> struct IntegerType { typedef unsigned type; };
7 using UnderlyingEnumType = typename IntegerType<sizeof(EnumT), (EnumT(-1) > EnumT(0))>::type;
9 template <class EnumT, class UnderlyingT = UnderlyingEnumType<EnumT>>
12 constexpr EnumMask(EnumT val) : m_val(val) {}
13 operator EnumT() { return m_val; }
18 enum class A : unsigned { x };
20 template <class EnumT>
21 EnumMask<EnumT> operator ~(EnumT lhs)
23 return EnumT(~unsigned(lhs) & unsigned(EnumT::maskAll)); // { dg-error "not a member" }