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++/64863] New: error for use of members of a forward declared enum is poor


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.

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