971031 and 971105: friendly template functions are not instantiated

Kevin Buhr buhr@stat.wisc.edu
Fri Nov 7 12:28:00 GMT 1997


Here's an architecture-independent bug in template instantiation.  In
a nutshell, functions marked as friends are not instantiated from
templates.  Consider the enclosed "bug.cc".  If we "MAKE_F_FRIENDLY",
then "f" is undefined in the object file.  Notice that if we also
"INSTATIATE_F_EXPLICITLY", the name mangling for the explicit instance
is different from the undefined implicit instance: perhaps this will
point someone to the source of the problem.

I've observed this bug on an "i486-pc-linux-gnulibc1" build of both
"971031" and "971105" and on a "sparc-sun-solaris2.5.1" build of
"971105".  FWIW, pre-ECGS gccs, like gcc-2.7.2.1, do not exhibit the
bug.

I've enclosed "bug.cc" and an illustration of the problem.

Kevin <buhr@stat.wisc.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug.cc
Type: text/x-c++
Size: 197 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/19971107/7171ba31/attachment.bin>


More information about the Gcc-bugs mailing list