This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/34338] error: no matching function for call to 'C::count()'
- From: "gray_song at yahoo dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 4 Dec 2007 23:40:14 -0000
- Subject: [Bug c++/34338] error: no matching function for call to 'C::count()'
- References: <bug-34338-15475@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from gray_song at yahoo dot com 2007-12-04 23:40 -------
(In reply to comment #2)
> The error is correct. The count without any arguments hide the one with (the
> other way is true too). You need to add using A::count in the class C and
> using C::count in class D.
>
Change the function C::count(int l) to following as suggested:
long long count(int l) {
return A::count();
}
The compiler complains:
hello.cpp: In function 'int main(char**)':
hello.cpp:31: error: no matching function for call to 'D::count(int)'
hello.cpp:21: note: candidates are: virtual long long int D::count()
Is there anyone around it?
--
gray_song at yahoo dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34338