This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/51851] New: Overriding a function with a parameter of dependent type fails to override.
- From: "ville.voutilainen at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 13 Jan 2012 19:01:53 +0000
- Subject: [Bug c++/51851] New: Overriding a function with a parameter of dependent type fails to override.
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51851
Bug #: 51851
Summary: Overriding a function with a parameter of dependent
type fails to override.
Classification: Unclassified
Product: gcc
Version: 4.7.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: ville.voutilainen@gmail.com
Test snippet:
template<class T>
struct A
{
typedef double Point[2];
virtual double calculate(const Point point) const = 0;
};
template<class T>
struct B : public A<T>
{
virtual double calculate(const typename A<T>::Point point) const
{
return point[0];
}
};
int main()
{
B<int> b;
return 0;
}
gcc says
ville.cpp: In function âint main()â:
ville.cpp:19:16: error: cannot declare variable âbâ to be of abstract type
âB<int>â
ville.cpp:9:8: note: because the following virtual functions are pure within
âB<int>â:
ville.cpp:5:24: note: double A<T>::calculate(const double*) const [with T =
int]