This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
overloaded templated ostream-operator: gcc can't find the right one.
- To: gcc-bugs at gcc dot gnu dot org
- Subject: overloaded templated ostream-operator: gcc can't find the right one.
- From: Johan Myhre Andersen <jma at cpk dot auc dot dk>
- Date: Wed, 01 Mar 2000 16:43:30 +0100
Hello,
I think I found a bug. To illustrate it I made the attached example.
With more than one templated overloaded ostream operator, gcc has
trouble finding the right one. It fails to convert a non-const argument
to a const arg. when the function is called. Instead it tries to match
the call to the wrong function.
I run solaris2.5.1 on a Sun Sparc.
Command-line for compilation/linking:
/pack/gcc-2.95.2/bin/g++ -v --save-temps -g template_ostream_test.cc -o
template_ostream_test.exe -R/pack/gcc-2.95.2/lib &>
template_ostream_test.make.log
attached is a .tar.gz with
template_ostream_test.cc
template_ostream_test.make.log
template_ostream_test.ii
template_ostream_test.o
template_ostream_test.s
Enjoy! :)
Regards,
Johan Andersen,
Aalborg University
template_ostream_test.tar.gz