// PR c++/53567 // { dg-do compile { target c++11 } } template struct IntegerType { typedef unsigned type; }; template using UnderlyingEnumType = typename IntegerType EnumT(0))>::type; template > struct EnumMask { constexpr EnumMask(EnumT val) : m_val(val) {} operator EnumT() { return m_val; } EnumT m_val; }; enum class A : unsigned { x }; template EnumMask operator ~(EnumT lhs) { return EnumT(~unsigned(lhs) & unsigned(EnumT::maskAll)); // { dg-error "not a member" } } int main() { ~A::x; return 0; }