OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [cpp0x/] [defaulted15.C] - Blame information for rev 693

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// PR c++/38796
2
// { dg-options -std=c++0x }
3
 
4
#define SA(X) static_assert ((X), #X)
5
 
6
struct A
7
{
8
  A (int);
9
  A (const A& = 1) = default;   // { dg-error "default argument" }
10
  void operator= (const A&) = default; // { dg-error "defaulted|match" }
11
};
12
 
13
struct B
14
{
15
private:
16
  B() = default;
17
};
18
 
19
SA(__has_trivial_constructor(B));
20
 
21
struct C
22
{
23
protected:
24
  ~C() = default;
25
};
26
 
27
SA(__has_trivial_destructor(C));
28
 
29
struct D
30
{
31
private:
32
  D& operator= (const D&) = default;
33
};
34
 
35
SA(__has_trivial_assign(D));
36
 
37
struct E
38
{
39
  explicit E (const E&) = default;
40
};
41
 
42
SA(__has_trivial_copy(E));
43
 
44
struct F
45
{
46
  F(F&) = default;          // { dg-error "non-const" }
47
};
48
 
49
struct G: public F
50
{
51
  // Can't be const because F copy ctor isn't.
52
  G(const G&) = default;    // { dg-error "const" }
53
};
54
 
55
struct H
56
{
57
  virtual ~H() = default;
58
};

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.