This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Bug?
- To: egcs-bugs at cygnus dot com
- Subject: Bug?
- From: Tobias Ringstrom <tori at prosolvia dot se>
- Date: Fri, 17 Jul 1998 16:30:05 +0200 (CEST)
- Organization: Prosolvia AB
I am not sure if this bug is in egcs or in my code, but the following code
compiled OK a few days ago. The problem occurs when the typedef is used to
define the member function.
template <class T> struct A {
void f();
};
typedef A<int> Ai;
#if 0
void A<char>::f() { } // This works
#else
void Ai::f() { } // Error here
#endif
template <class T> void A<T>::f() { }
I would be happy if someone knowledgeable would speak up as to weather my code
is in error.
Using the CVS egcs from 1998-07-17 on i686-pc-linux-gnu, I get:
> g++ -c test1.cpp
test1.cpp:8: new declaration `void Ai::f<int>()'
test1.cpp:2: ambiguates old declaration `void A<int>::f<int>()'
Btw, the bug I reported in
http://www.cygnus.com/ml/egcs-bugs/1998-Jul/0341.html
seems to be fixed. Thanks!
/ Tobias