Apparant C++ bug in gcc 2.95.2 and latest egcs snapshot
Nicholas Vinen
hb@fl.net.au
Fri Mar 17 00:04:00 GMT 2000
OK, code is included. If this isn't a bug, it's definately
strange.
Compile the program. It compiles fine.
Now try compiling with -fno-default-inline. It compiles but fails
to link. If you add "inline" to that friend operator definition on line
50, it works.
It seems to me, it shouldn't matter if a function is declared
inline or not whether the code links... I don't know why the person that
wrote this code declared the operator that way but it seems to work under
all circumstances but this with this and other compilers. For now I'll
declare it inline, hopefully you can work out why it's doing this so I
don't have to.
Nicholas Vinen
---
"... one of the main causes of the fall of the Roman Empire was that,
lacking zero, they had no way to indicate successful termination of
their C programs."
-- Robert Firth
More information about the Gcc-bugs
mailing list