This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82097] New: Invalid warning: declaration enum does not declare anything
- From: "d.v.a at ngs dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 04 Sep 2017 10:35:16 +0000
- Subject: [Bug c++/82097] New: Invalid warning: declaration enum does not declare anything
- Auto-submitted: auto-generated
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;
^~~~