https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64863
Bug ID: 64863
Summary: error for use of members of a forward declared enum is
poor
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: tbsaunde at gcc dot gnu.org
consider this test case
enum class foo;
int bar();
int main()
{
if (bar() < foo::baz)
return 0;
return 1;
}
produces
test.cpp: In function ‘int main()’:
test.cpp:7:14: error: ‘baz’ is not a member of ‘foo’
if (bar() < foo::baz)
^
which while true isn't terrible helpful. I'd think it would be better to say
only a forward declaration of foo has been seen, and to use members you need
the full definition.