[Bug c++/82097] New: Invalid warning: declaration enum does not declare anything
d.v.a at ngs dot ru
gcc-bugzilla@gcc.gnu.org
Mon Sep 4 10:35:00 GMT 2017
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;
^~~~
More information about the Gcc-bugs
mailing list