Public bug reported:

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>}’

** Affects: gcc-7 (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "bug2.ii"
   https://bugs.launchpad.net/bugs/1827800/+attachment/5261664/+files/bug2.ii

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1827800

Title:
  Polymorphism issue. Member function of parent class is not visible

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gcc-7/+bug/1827800/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to