public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de>
To: ersmith@ucsd.edu
Cc: bug-gcc@gnu.org
Subject: Re: template bug
Date: Wed, 19 Apr 2000 13:54:00 -0000	[thread overview]
Message-ID: <200004192043.WAA01386@loewis.home.cs.tu-berlin.de> (raw)
In-Reply-To: <4.2.0.58.20000419065144.01971ba0@popmail.ucsd.edu>

> g++ should be able to resolve the call to the overloaded function:

Thanks for your bug report. This is not a bug in the compiler, but in
your code. Both candidates are viable, they require the same
conversion sequences on arguments, and neither is as specialized as
the other.

If you question this line of reasoning, please discuss it in one of
the public C++ fora first, eg. comp.lang.c++.moderated, or
comp.std.c++.

Regards,
Martin
>From ovi@physics.utoronto.ca Wed Apr 19 14:16:00 2000
From: Ovidiu Toader <ovi@physics.utoronto.ca>
To: gcc-bugs@gcc.gnu.org
Subject: gcc-2_95-branch bootstrap failure
Date: Wed, 19 Apr 2000 14:16:00 -0000
Message-id: <38FE21DB.2A8CF751@physics.utoronto.ca>
X-SW-Source: 2000-04/msg00544.html
Content-length: 1791

phoenix:lang/gcc/egcs.rls> uname -a
Linux phoenix.physics.utoronto.ca 2.2.14 #5 Mon Feb 7 18:45:19 EST 2000
alpha unknown
phoenix:lang/gcc/egcs.rls> gmake CFLAGS='-O2' LIBCFLAGS='-g -O2'
LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap-lean
...
...
cp stdlist tlist
if [ x"yes" = xyes ]; then \
  sed 's,\([A-Za-z_]*\.o\),pic/\1,g' tlist > tlist2 ; \
  mv tlist2 tlist ; \
else true ; fi
mv tlist piclist
/usr/local/Packages/lang/gcc/egcs.rls/objects/gcc/xgcc
-B/usr/local/Packages/lang/gcc/egcs.rls/objects/gcc/
-B/usr/local/Packages/lang/gcc/egcs.rls/install/alph
aev6-unknown-linux-gnu/bin/ -g -O2 -fvtable-thunks -D_GNU_SOURCE
-fno-implicit-templates -Wl,-soname,libstdc++-libc6.1-2.so.3 -shared -o
libstdc++-3-libc6.1-2-2.10.0.so `cat piclist` -lm
../libio/pic/strstream.o: In function `iostream::iostream(int)':
/usr/local/Packages/lang/gcc/egcs.rls/objects/alphaev6-unknown-linux-gnu/libio/../../../egcs/libio/strstream.h:83:
multiple definition of`iostream::iostream(int)'
../libio/pic/fstream.o(.text+0x0):/usr/local/Packages/lang/gcc/egcs.rls/objects/alphaev6-unknown-linux-gnu/libio/../../../egcs/libio/fstream.cc:
first defined here
../libio/pic/pfstream.o: In function `ofstream::ofstream(int)':
/usr/local/Packages/lang/gcc/egcs.rls/objects/alphaev6-unknown-linux-gnu/libio/../../../egcs/libio/pfstream.cc:74:
multiple definition of
`ofstream::ofstream(int)'../libio/pic/PlotFile.o(.text+0x0):/usr/local/Packages/lang/gcc/egcs.rls/objects/alphaev6-unknown-linux-gnu/libio/../../../egcs/libio/PlotFile.cc:
first defined here
collect2: ld returned 1 exit status
gmake[1]: *** [libstdc++-3-libc6.1-2-2.10.0.so] Error 1
gmake[1]: Leaving directory
`/usr/local/Packages/lang/gcc/egcs.rls/objects/alphaev6-unknown-linux-gnu/libstdc++'
gmake: *** [all-target-libstdc++] Error 2
>From rolly@free.fr Wed Apr 19 14:18:00 2000
From: Arnaud Rolly <rolly@free.fr>
To: gcc-bugs@gcc.gnu.org
Subject: GCC Bug ?
Date: Wed, 19 Apr 2000 14:18:00 -0000
Message-id: <00041922441000.01083@localhost.localdomain>
X-SW-Source: 2000-04/msg00545.html
Content-length: 521

I've a problem with gcc :

[root@localhost audio]# g++ -c sound.cpp
sound.cpp:20: Internal compiler error.
sound.cpp:20: Please submit a full bug report.
sound.cpp:20: See <URL: http://www.gnu.org/software/gcc/faq.html#bugreport > for instructions.
[root@localhost audio]# g++ -v
Reading specs from /usr/lib/gcc-lib/i586-mandrake-linux/2.95.2/specs
gcc version 2.95.2 19991024 (release) 

I've the Mandrake 7.0.

The 'problematic files' are attached to the mail.

Please keep me informed.

-- 
Arnaud Rolly
rolly@free.fr
>From martin@loewis.home.cs.tu-berlin.de Wed Apr 19 14:53:00 2000
From: "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de>
To: laufreeman@hotmail.com
Cc: gcc-bugs@gcc.gnu.org
Subject: Re: Help me ,nested template!!!!!!!!!!!!!!!
Date: Wed, 19 Apr 2000 14:53:00 -0000
Message-id: <200004192147.XAA01514@loewis.home.cs.tu-berlin.de>
References: <20000414130908.87654.qmail@hotmail.com>
X-SW-Source: 2000-04/msg00546.html
Content-length: 1103

> I defined a template class Poly in poly.h
> template <class T,class S>
> class Poly{
>         .
>         .
>         .
>         .
> //and a friend function
> 
> friend Poly<T,S>  operator* <>(const T &c,const Poly<T,S> &pl) ;
> };

I guess you also have an operator* in that function. In standard C++,
you should now write

 friend Poly<T,S>  ::operator* <>(const T &c,const Poly<T,S> &pl) ;

because operator* probably refers to the other operator* in the class,
not to the global function.

> but I used g++2.905 and succeeded,what should I do?

A number of things. First, please try to get familiar with the bug
reporting instructions, as summarized in

http://www.gnu.org/software/gcc/bugs.html

Also, have a look at the section "Reporting Bugs". If you really want
to report a bug, you must include all details.

If you want to get your code working, I recommend removing the friend
declaration, and arranging the members that this operator needs to
access to be public members. Alternatively, you could also introduce a
helper friend function which is not called operator*.

Regards,
Martin


       reply	other threads:[~2000-04-19 13:54 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4.2.0.58.20000419065144.01971ba0@popmail.ucsd.edu>
2000-04-19 13:54 ` Martin v. Loewis [this message]
1999-10-31 23:03 Template bug Daniel Oram
1999-10-10 16:46 ` Martin v. Loewis
  -- strict thread matches above, loose matches on Subject: below --
1999-06-30 23:07 Sebastian Rittau
2000-02-25  0:31 ` Martin v. Loewis
1999-02-28 23:30 template bug Arturo Montes
1999-01-18 21:34 Template bug Richard Heller
1999-01-19 14:40 ` Alexandre Oliva
1998-09-28  7:44 template bug Oskar Enoksson
1998-05-14 14:34 Template bug Theron Lewis
1998-05-15  8:05 ` Ian Haggard
1998-04-01 23:39 template bug Mark van Doesburg
1997-12-09  8:33 Template bug Konstantin Baumann
1997-12-09 16:41 ` Mark Mitchell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200004192043.WAA01386@loewis.home.cs.tu-berlin.de \
    --to=martin@loewis.home.cs.tu-berlin.de \
    --cc=bug-gcc@gnu.org \
    --cc=ersmith@ucsd.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).