It has to do with the order of type deduction and overload resolution.
Type deduction is always performed first.
In the first case, T is given from the use of MyClass<int>. That class
instantiation has a member operator that takes an int, and the enum is
convertible to int. Good.
In the second case, the compiler is looking for an operator that takes a
class object and an enum value. There isn't any.
The fact that the enum might be convertible to some other type that
would match the template doesn't help, as type deduction is performed
first and enumVal1 just isn't a T. So that template is not added to the
potential overload set.
Bo Persson