This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Is this a bug?
- To: <egcs-bugs at egcs dot cygnus dot com>
- Subject: Is this a bug?
- From: "Christian II" <CHRISTIANII at prodigy dot net>
- Date: Tue, 11 May 1999 23:05:57 -0500
- Organization: Prodigy Internet
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);
}