Polymorphism issue. Member function of parent class is not visible

Bug #1827800 reported by Alexey Kozin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gcc-7 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Struct A declares a function 'f' with a parameter of type typename std::integral_constant<size_t,0>::type.
Struct B inherits class A and declares a function with a parameter of type typename std::integral_constant<size_t,1>::type and the same name 'f'.
A::f is not accessible.

struct A
{
 static void f(typename std::integral_constant<size_t,0>::type){}
};

struct B: public A
{
 static void f(typename std::integral_constant<size_t,1>::type){}
};

void tst()
{
 B::f(std::integral_constant<size_t,0>::type());
}

error: no matching function for call to ‘B::f(std::integral_constant<long unsigned int, 0>::type)’
no known conversion for argument 1 from ‘std::integral_constant<long unsigned int, 0>::type {aka std::integral_constant<long unsigned int, 0>}’ to ‘std::integral_constant<long unsigned int, 1>::type {aka std::integral_constant<long unsigned int, 1>}’

Revision history for this message
Alexey Kozin (kozin1972) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.