language: C++ 4.7.2 (gcc-4.7.2)
date: 456 days 8 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
 
struct A
{
    void f() { std::cout << "A::f()" << std::endl; }
};
 
struct B : A
{
    void f(int) { std::cout << "B::f(int)" << std::endl; }
};
 
int main() {
        B b;
        b.f(10); //ok
        b.f();   //error - as the function is hidden
        return 0;
}
prog.cpp: In function ‘int main()’:
prog.cpp:16: error: no matching function for call to ‘B::f()’
prog.cpp:10: note: candidates are: void B::f(int)