This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15639] New: Fails to find inherited function
- From: "igodard at pacbell dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 May 2004 22:32:53 -0000
- Subject: [Bug c++/15639] New: Fails to find inherited function
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
template<typename T>
class A{
public:
T* F(int i) { return 0;}
};
template<typename U, template<typename> class B>
class C: public B<U> {
public:
void G() {
U* u = F(5);
}
};
int main() {
C<bool, A> c;
c.G();
return 0;
}
gives:
~/ootbc/common/test/src$ g++ foo.cc
foo.cc: In member function `void C<U, B>::G()':
foo.cc:11: error: there are no arguments to `F' that depend on a template parameter, so a declaration of `F' must be available
foo.cc:11: error: (if you use `-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
However, the explicit invocation of C<bool, A> binds U to bool and B to A, so the "c" derives from A<bool>, which does in fact have an F(int) to call and is available.
Ivan
--
Summary: Fails to find inherited function
Product: gcc
Version: 3.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: igodard at pacbell dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15639