[Bug c++/101869] New: [9/10/11/12 Regression] &enumclass::enumvalue is rejected

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Aug 12 01:07:00 GMT 2021


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

            Bug ID: 101869
           Summary: [9/10/11/12 Regression] &enumclass::enumvalue is
                    rejected
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: rejects-valid
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

Take:
enum E { A };
E operator & (E e)
{
  return e;
}
E f(void)
{
    return &E::A;
}

------ CUT ----
This used to work in GCC 4.7.x and stopped working in GCC 4.8.x.  Puting
parentheses around E::A allows it work.


More information about the Gcc-bugs mailing list