This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/47752] New: Non-dependent name is found in dependent base class although it should be rejected
- From: "volker.simonis at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 15 Feb 2011 13:47:57 +0000
- Subject: [Bug c++/47752] New: Non-dependent name is found in dependent base class although it should be rejected
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47752
Summary: Non-dependent name is found in dependent base class
although it should be rejected
Product: gcc
Version: 4.5.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: volker.simonis@gmail.com
Consider the following example:
===================================================
template<typename T> struct B {
void f(int i) { }
void f2() { }
};
template<typename T> struct D : public B<T> {
int foo(int i) {
return i;
}
void g() {
// f(42); // (1)
f(foo(42)); // (2)
// f2(); // (3)
}
};
struct E : public D<int> {
void h() {
g();
}
};
=====================================================
This compiles fine with g++ 4.5.2.
If one of the lines (1) or (2) is uncommented, the compilation fails with:
dependent2.cpp:11: error: there are no arguments to âfâ that depend on a
template parameter, so a declaration of âfâ must be available
dependent2.cpp:13: error: there are no arguments to âf2â that depend on a
template parameter, so a declaration of âf2â must be available
I think the compilation of the call 'f(foo(42))' should fail for the same
reason.
Regards,
Volker