language: C++ 4.7.2 (gcc-4.7.2)
date: 614 days 3 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
struct Shape;
struct Circle;
struct Rectangle;
 
struct Shape
{
    virtual bool is_equal(const Shape& s) const { return false; };
};
 
struct Rectangle : Shape
{
    virtual bool is_equal(const Rectangle& r) const { return true; };
};
 
int main(void)
{
    Rectangle x;
    Shape y;
    return x.is_equal(y);
}
 
prog.cpp: In function ‘int main()’:
prog.cpp:19: error: no matching function for call to ‘Rectangle::is_equal(Shape&)’
prog.cpp:12: note: candidates are: virtual bool Rectangle::is_equal(const Rectangle&) const