repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* decl.c (make_typename_type): s/parameters/arguments/.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
defaulted1.C
blob
4956e88ed652702adb75277b289d776edc9296e2
1
// Positive test for defaulted/deleted fns
2
// { dg-do run { target c++11 } }
3
4
struct A
5
{
6
int i;
7
A() = default;
8
A(const A&) = delete;
9
A& operator=(const A&) = default;
10
~A();
11
};
12
13
A::~A() = default;
14
15
void f() = delete;
16
17
struct B
18
{
19
int i;
20
B() = default;
21
};
22
23
int main()
24
{
25
A a1, a2;
26
B b = {1};
27
a1 = a2;
28
}
29
30
// fns defaulted in class defn are trivial
31
struct C
32
{
33
C() = default;
34
C(const C&) = default;
35
C& operator=(const C&) = default;
36
~C() = default;
37
};
38
39
union U
40
{
41
C c;
42
};