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
[AArch64] Fix SVE testsuite failures for ILP32 (PR 83846)
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
lambda-init8.C
blob
21933bd3e1b1e2acce7fffec5514a292a4d30cd6
1
// DR1760: "no additional copy and destruction is performed"
2
// { dg-do run { target c++14 } }
3
4
#include <cassert>
5
6
int copy_count = 0;
7
int dtor_count = 0;
8
9
struct X
10
{
11
X() = default;
12
X(const X&) { ++copy_count; }
13
~X() { ++dtor_count; }
14
};
15
16
int main()
17
{
18
{
19
X x;
20
auto z = [y = x](){};
21
X x2;
22
auto z2 = [x2](){};
23
assert(copy_count == 2);
24
}
25
assert(dtor_count == 4);
26
}