This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c++/9355: Base class member not known by derived class constructor's initialization list
- From: piotr at jachowicz dot pl
- To: gcc-gnats at gcc dot gnu dot org
- Date: 17 Jan 2003 19:30:07 -0000
- Subject: c++/9355: Base class member not known by derived class constructor's initialization list
- Reply-to: piotr at jachowicz dot pl
>Number: 9355
>Category: c++
>Synopsis: Base class member not known by derived class constructor's initialization list
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Fri Jan 17 11:36:00 PST 2003
>Closed-Date:
>Last-Modified:
>Originator: Piotr Jachowicz
>Release: gcc version 3.2 20020927 (prerelease)
>Organization:
>Environment:
gcc on cygwin on WinNT SP6
>Description:
del_spr01.cpp: In constructor `B::B()':
del_spr01.cpp:37: class `B' does not have any field named `i'
>How-To-Repeat:
class A {
public:
int i;
};
class B : public A {
public:
B() : i(5) {}
};
>Fix:
class A {
public:
int i;
};
class B : public A {
public:
B() {i = 5;}
};
>Release-Note:
>Audit-Trail:
>Unformatted: