Article View: gnu.g++.bug
Article #90A problem with typedef'ed enums
From: ojr
Date: Mon, 03 Jul 1989 17:07
Date: Mon, 03 Jul 1989 17:07
72 lines
1847 bytes
1847 bytes
I'm not quite sure if this is a bug, but anyway:
If I use typedefs in enum declaration the compiler has problems when
generating overloaded function symbols. The problem goes away if I use
an enum declaration of the type:
enum e1 {e11, e12};
-----------------------------------------------
Configuaration:
config.g++ sun3-os4
g++ version 1.35.1-
SUN3
SUNOS 4.0.1
-----------------------------------------------
Repeat by:
cat > test1.h <<EOF1
typedef enum { e11, e12 } e1;
EOF1
cat > test2.h << EOF2
typedef enum { e21, e22 } e2;
EOF2
cat > test1.cc << EOF3
#include "test2.h"
void p(e2);
overload func;
void func(e2 i)
{
}
EOF3
cat > test2.cc <<EOF4
#include "test1.h"
#include "test2.h"
overload func;
void func(e2);
main()
{
func(e21);
}
EOF4
cat > doit <<EOF5
g++ -c test1.cc
g++ -c test2.cc
g++ test1.o test2.o
nm test1.o test2.o
EOF5
------------------------------------------------
Running the script gives:
sh doit
test2.o: Undefined symbol _func_E$_1 referenced from text
test1.o:
00000000 T _func_E$_0
00000000 t gcc_compiled.
test2.o:
U _func_E$_1
00000000 T _main
00000000 t gcc_compiled.
Compilation finished at Mon Jul 3 17:56:11
Ornulf Jan Rodseth Telephone
SINTEF Dep. of Automatic Control (+47 7) 594351 Direct
N-7034 TRONDHEIM (+47 7) 594375 Switchboard
NORWAY (+47 7) 594399 Fax
ojr%regtek.unit.uninett@tor.nta.no (EAN) ojr@itk.unit.no (ARPA)
Technical Details
Message-ID:
<8907031709.AA07251@inge.itk.unit.no>Path:
arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!itk.unit.no!ojrShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!itk.unit.no!ojr From: ojr@itk.unit.no Newsgroups: gnu.g++.bug Subject: A problem with typedef'ed enums Message-ID: <8907031709.AA07251@inge.itk.unit.no> Date: 3 Jul 89 17:07:14 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 72