This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
template func + typname param: g++ says illegal, is it?
- To: egcs-bugs at sourceware dot cygnus dot com, gcc-bugs at gcc dot gnu dot org, bug-gcc at gnu dot or
- Subject: template func + typname param: g++ says illegal, is it?
- From: Yotam Medini <ymedini at iil dot intel dot com>
- Date: Tue, 11 Jul 2000 10:11:15 +0300
- Reply-to: ymedini at iil dot intel dot com
Is g++ right saying the following is illegal C++ code?
iwsl010:3378> cat ftmpln.cc
template <class T>
class C {
public:
class I {
public:
I() {}
}; // I
C() {}
T _t;
}; // C
template <class T>
bool f(typename C<T>::I& ci) {
return true;
} // f
int main(int, char**) {
C<int>::I ci;
bool bi = f<int>(ci);
bool b = f(ci);
return !(bi && b);
} // main
iwsl010:3379> g++ -v; g++ -c ftmpln.cc
Reading specs from (...)/gcc-2.95.2/lib/gcc-lib/i686-pc-linux-gnu/2.95.2/specs
gcc version 2.95.2 19991024 (release)
ftmpln.cc: In function `int main(int, char **)':
ftmpln.cc:20: no matching function for call to `f (C<int>::I &)'
By the way, HP's aCC complains as well.
-- yotam