repo.or.cz
/
gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fortran: Fix PR 47485.
[gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp0x
/
initlist-nrv1.C
blob
e44dbecfece4ffbbf8552c65d3669ed62fba0dac
1
// PR c++/101442
2
// { dg-do run { target c++11 } }
3
4
bool destroyed = false;
5
6
struct A
7
{
8
A() {}
9
A(const A &) = delete;
10
A &operator=(const A &) = delete;
11
~A() {destroyed = true;}
12
};
13
14
struct B
15
{
16
const A &a;
17
struct string {
18
string(const char*) { }
19
~string() { }
20
} s;
21
};
22
23
B foo()
24
{
25
B ret{ A{}, "" };
26
return ret;
27
}
28
29
int main()
30
{
31
B b = foo();
32
if (!destroyed)
33
__builtin_abort();
34
}