OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
PR c++/44157
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
defaulted1.C
1
// 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
};