summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.law/access4.C
blob: 174c441d31c2c209d0d16537f6f62145216d287c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// { dg-do assemble  }
// 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 { // { dg-error "" } 
    friend class Sterile;
      ForceLeafSterile() {} // { dg-error "" } 
};

class Sterile : private virtual ForceLeafSterile {
public:
    Sterile() {}
    Sterile(const char* /*blah*/) {}
};

class Illegitimate : public Sterile {
public:
    Illegitimate() {}           // { dg-error "" }  can't access virtual base deflt ctor
    Illegitimate(const char* /*blah*/)
        : ForceLeafSterile() {} // { dg-error "" } can't access default ctor
    Illegitimate(const Illegitimate&)
        {}                      // { dg-error "" } can't access default ctor
};