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
PR c++/56973, DR 696 - capture constant variables only as needed.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
auto-fn17.C
blob
1647107e54a0240222b2eb95cdb36b43b1a5d253
1
// { dg-do run { target c++14 } }
2
3
int c;
4
int d;
5
6
struct A
7
{
8
A() { ++c; }
9
A(const A&) { ++c; }
10
~A() { ++d; }
11
};
12
13
A g() { return A(); }
14
decltype(auto) f() { return g(); }
15
16
int main()
17
{
18
f();
19
if (c < 1 || c != d)
20
__builtin_abort ();
21
}