summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/warn3.C
blob: 3080f93b9cbd46ad56c99ab6b458b56da6f1eb76 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
// { dg-do assemble  }
// { dg-options "-Wctor-dtor-privacy" }

class A {
};


class B { // { dg-warning "" } only private constructors
public:
  void f();

private:
  B (); 
  B (const B&);
};


class C {  // { dg-warning "" } only private destructors
public: 
  void f();

private:
  ~C (); 
};


class D { // { dg-warning "" } all member functions are private
private:
  void f(); 
};


template <class T>
class X { // { dg-warning "" } only private destructors
private:
  ~X (); 
};

template class X<int>;
template class X<double>;


template <class T>
class Y { // { dg-warning "" } only private constructors
private:
  Y (); 
  Y (const Y&);
};


template <class T>
class Z { // { dg-warning "" } all member functions are private
private:
  void f(); 
};