This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C++ problem with virtual inheritance accessibility
- To: gcc-bugs at gcc dot gnu dot org
- Subject: C++ problem with virtual inheritance accessibility
- From: Kenny Simpson <theonetruekenny at yahoo dot com>
- Date: Mon, 8 Jan 2001 10:12:27 -0800 (PST)
From what I've read, using virtual private
inheritance is an idiom that can prevent a class from
being inherited. However, the following test case
successfully compiles on gcc 2.95.2 and on the gcc
version 2.97 20010103 (experimental) snapshot from the
online compiler submission site.
test.cc:
struct Base {};
struct VPD : virtual private Base {};
// it should be impossible to inherit from VPD, but...
struct Impossible : public VPD
{
// implicit Impossible::Impossible() : Base(), VPD()
{}
// Base() should not be accessible
};
int main()
{
Imp i1; // should cause implicit
Impossible::Impossible() to be defined
return 0;
}
Thanks,
-Kenny
__________________________________________________
Do You Yahoo!?
Yahoo! Photos - Share your holiday photos online!
http://photos.yahoo.com/