Thread View: gnu.g++.bug
1 messages
1 total messages
Started by ojr
Mon, 03 Jul 1989 17:07
A problem with typedef'ed enums
Author: 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)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads