summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/defaulted15.C
blob: b54cedb0bccb093643d2f9295e22a36aaa414f41 (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
// PR c++/38796
// { dg-options -std=c++0x }

struct A
{
  A (int);
  A (const A& = 1) = default;	// { dg-error "default argument" }
  void operator= (const A&) = default; // { dg-error "defaulted|match" }
};

struct B
{
private:
  B() = default;		// { dg-error "access" }
};

struct C
{
protected:
  ~C() = default;		// { dg-error "access" }
};

struct D
{
private:
  D& operator= (const D&) = default; // { dg-error "access" }
};

struct E
{
  explicit E (const E&) = default; // { dg-error "explicit" }
};

struct F
{
  F(F&) = default;		// { dg-error "non-const" }
};

struct G: public F
{
  // Can't be const because F copy ctor isn't.
  G(const G&) = default;	// { dg-error "const" }
};

struct H
{
  virtual ~H() = default;	// { dg-error "declared virtual" }
};