summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/access18.C
blob: 900058caba933ef6efc2c1c472ff1939991a7f0c (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
// { dg-do assemble  }
// { dg-options "-w" }
// PRMS Id: 5073
// Bug: g++ doesn't catch access violations in base initializers.

int r = 0;
class A {
  private:
    A() { r = 1; }		// { dg-error "" } 
    ~A() {}			// { dg-error "" } 
};
    
class B : public A {
  public:
    B(): A() {}			// { dg-error "" } 
    B(const B&) {}		// { dg-error "" } 
    ~B() { }			// { dg-error "" } private dtor
};

main()
{
  B b;
  return r;
}