template func + typname param: g++ says illegal, is it?
Yotam Medini
ymedini@iil.intel.com
Tue Jul 11 00:11:00 GMT 2000
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
More information about the Gcc-bugs
mailing list