This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/82097] New: Invalid warning: declaration enum does not declare anything


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

            Bug ID: 82097
           Summary: Invalid warning: declaration enum does not declare
                    anything
           Product: gcc
           Version: 7.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: d.v.a at ngs dot ru
  Target Milestone: ---

This code

struct settings
{
    enum class step { step1_clear, step2_copy };
    step step;
};

inline const char *to_text(enum settings::step v)
{
    using step = enum settings::step;
    switch(v)
    {
        case step::step1_clear: return "STEP1";
        case step::step2_copy: return "STEP2";
    }
}

produces strange warning:

warning: declaration 'enum class settings::step' does not declare anything
     using step = enum settings::step;
                                 ^~~~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]