c++/587: incorrect making romb-hierarchy in c++
tomcat@7ka.mipt.ru
tomcat@7ka.mipt.ru
Sun Oct 1 06:06:00 GMT 2000
>Number: 587
>Category: c++
>Synopsis: incorrect making romb-hierarchy in c++
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Sun Oct 01 06:06:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Klochkov Roman
>Release: gcc version 2.95.2 19991024 (release)
>Organization:
>Environment:
i686
kernel 2.2.17
Linux Slackware 7.1
>Description:
>How-To-Repeat:
#include <iostream.h>
class A
{
public:
int x;
};
class B: public A
{
};
class C: public A
{
};
class D: public B, public C
{
};
void main()
{
D obj;
((B)obj).x=1;
cout << ((B)obj).x; // prints not 1
}
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-bugs
mailing list