This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c++/587: incorrect making romb-hierarchy in c++



>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:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]