language: C++ 4.7.2 (gcc-4.7.2)
date: 621 days 9 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
class Shape;
class Circle;
class Rectangle;
 
class Shape
{
    virtual bool is_equal(const Shape& s) const { return false; };
};
 
class Rectangle : public 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