Fix PR c++/70241 (inconsistent access with in-class enumeration)