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

Subversion Repositories openrisc

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

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
// Positive test for defaulted/deleted fns
2
// { dg-do run }
3
// { dg-options "-std=c++0x" }
4
 
5
struct A
6
{
7
  int i;
8
  A() = default;
9
  A(const A&) = delete;
10
  A& operator=(const A&) = default;
11
  ~A();
12
};
13
 
14
A::~A() = default;
15
 
16
void f() = delete;
17
 
18
struct B
19
{
20
  int i;
21
  B() = default;
22
};
23
 
24
int main()
25
{
26
  A a1, a2;
27
  B b = {1};
28
  a1 = a2;
29
}
30
 
31
// fns defaulted in class defn are trivial
32
struct C
33
{
34
  C() = default;
35
  C(const C&) = default;
36
  C& operator=(const C&) = default;
37
  ~C() = default;
38
};
39
 
40
union U
41
{
42
  C c;
43
};

powered by: WebSVN 2.1.0

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