Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Mike Bolotski
Wed, 15 Nov 1989 06:15
Constructor of a private base class
Author: Mike Bolotski
Date: Wed, 15 Nov 1989 06:15
Date: Wed, 15 Nov 1989 06:15
37 lines
1615 bytes
1615 bytes
Why is the constructor for Beta prohibited from using the Alpha
constructor? Is it a tightening of the privacy mechanism in 2.0?
Code similar to that below compiled fine using 1.35.1.
Script started on Tue Nov 14 22:11:35 1989
coho{mikeb}68: g++ -v gamma.cc
gcc version 1.36.1 (based on GCC 1.36)
/usr/local/lib/gnu/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -D__HAVE_68881__ -Dmc68020 gamma.cc /usr/tmp/cca18626.cpp
GNU CPP version 1.36
/usr/local/lib/gnu/gcc-cc1plus /usr/tmp/cca18626.cpp -quiet -dumpbase gamma.cc -version -o /usr/tmp/cca18626.s
GNU C++ version 1.36.1 (based on GCC 1.36) (68k, MIT syntax) compiled by GNU C version 1.36.
default target switches: -m68020 -mc68020 -m68881 -mbitfield
gamma.cc: In method Beta::Beta (const class Beta &):
gamma.cc:16: type `Beta' is derived from private `Alpha'
coho{mikeb}69: cat gamma.cc
class Alpha {
int x;
public:
Alpha(int);
Alpha(const Alpha&);
};
class Beta: private Alpha
{
int y;
public:
Beta(const Beta&);
};
Beta::Beta(const Beta& b) : Alpha(b) {}
coho{mikeb}70: exit
exit
script done on Tue Nov 14 22:12:10 1989
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads