This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
No Subject
- To: root at mad_max dot volgacom dot samara dot su
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sat, 21 Mar 1998 10:50:29 +0100
- CC: egcs-bugs at cygnus dot com
- References: <199803191216.QAA25717@mad_max.volgacom.samara.su>
> egcs_bug.cc: In function `int main()':
> egcs_bug.cc:13: no matching function for call to `B<int>::a ()'
> egcs_bug.cc:8: candidates are: B<int>::a(int)
The compiler is right, your code is wrong. There is no B<int>::a(),
since A<int>::a() is shadowed by B<int>::a(int). One possible
correction is
template <class T>
struct A {
void a() {}
};
template <class T>
struct B: public A<T> {
void a( int ) {}
};
main()
{
B<int>().A::a();
}
Regards,
Martin