[Bug c++/100862] New: using enum member access fail

eligorkadaf at gmail dot com gcc-bugzilla@gcc.gnu.org
Tue Jun 1 19:53:47 GMT 2021


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

            Bug ID: 100862
           Summary: using enum member access fail
           Product: gcc
           Version: 11.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eligorkadaf at gmail dot com
  Target Milestone: ---

The following code must compile according to C++20 standard. However, gcc fails
to compile it

enum class fruit { orange, apple };

struct Working {
    using enum fruit;
};

struct Broken {
    using enum fruit;
private:
};

int main() {
    Working::orange;
    Broken::orange;
}

Link to godbolt(I don't have gcc-11 installed): https://godbolt.org/z/srYj3sMno

Link to C++-draft clause: http://eel.is/c++draft/namespace.udecl#16


More information about the Gcc-bugs mailing list