enum declaration/definition bug

Harald Iwe hiw@funcom.com
Thu Oct 15 01:44:00 GMT 1998


The following program does not compile: 

enum Answer_e;

enum Answer_e
{
  ONE, TWO, TREE
};

int
main()
{
  return 0;
}

Output:
[hiw@hartmann tmp]$ g++ -g -Wall junk.cpp 
junk.cpp:2: use of enum `Answer_e' without previous declaration
junk.cpp:6: multiple definition of `enum Answer_e'


Operating System : Linux 2.1.115
Compiler : gcc version egcs-2.91.57 19980901 (egcs-1.1 release)

-- 
Harald Iwe, hiw@funcom.com
Funcom Oslo A/S, Karenlyst alle' 5, N-0277 Oslo, Norway
Tel. +47 22-925963, Fax. +47 22-420302



More information about the Gcc-bugs mailing list