https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122806

            Bug ID: 122806
           Summary: member enumerators
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

g++ accepts this fully, while clang++ rejects foo return and accepts bar
return.
For unscoped enumerators at class scope the standard clearly says that e.g.
T::G
is a member of the class, but for scoped enums I think that is not the case. 
So shall we reject foo as well?

struct S { enum class E { F, G } h; };
struct T { enum E { F, G } h; };

auto
foo (S &s)
{
  return s.S::E::G;
}

auto
bar (T &t)
{
  return t.T::E::G;
}

Reply via email to