Is this a bug?
Christian II
CHRISTIANII@prodigy.net
Tue May 11 21:09:00 GMT 1999
Is this a bug in the compiler?
I am using version 1.1.2 of the egcs compiler; and when I compile the
following program in DOS or linux, I get this output:
test.cpp: In function `int main()':
test.cpp:33: no matching function for call to `Triangle::render (int, int,
int)'
test.cpp:27: candidates are: Triangle::render()
Shouldn't it call Object::render(float, float, float)? Instead,
Triangle::render() overrides it!
Could you please E-mail me about this at: christianii@prodigy.net
// test program
class Object
{
public:
virtual void move(float x, float y, float z);
virtual void render(); // render at origin
void render(float x, float y, float z) // render at x,y,z
{move(x,y,z); render(); move(-x,-y,-z);}
};
class Triangle
{
float v[3][3];
public:
virtual void move(float x, float y, float z);
virtual void render();
};
main()
{
Triangle t;
t.render(0, 0, -5);
}
More information about the Gcc-bugs
mailing list