8sa1-gcc/gcc/testsuite/g++.old-deja/g++.law/access4.C
Jeff Law 921e5a0eb4 Initial revision
From-SVN: r14840
1997-08-19 01:34:40 -06:00

28 lines
830 B
C

// Build don't link:
// GROUPS passed access
// (Message bugs/access:3)
// From: jamshid@ses.com (Jamshid Afshar)
// Date: Wed, 2 Mar 94 18:24:22 CST
// Subject: g++ 2.5.5 doesn't warn about inaccessible virtual base ctor
// Message-ID: <9403030024.AA04534@ses.com>
class ForceLeafSterile {
friend class Sterile;
ForceLeafSterile() {} // ERROR -
};
class Sterile : private virtual ForceLeafSterile {
public:
Sterile() {}
Sterile(const char* /*blah*/) {}
};
class Illegitimate : public Sterile {
public:
Illegitimate() {} // ERROR - can't access virtual base deflt ctor
Illegitimate(const char* /*blah*/)
: ForceLeafSterile() {} // ERROR - can't access default ctor
Illegitimate(const Illegitimate&)
{} // ERROR - can't access default ctor
};