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
/
pr77591.C
blob
8f9e28c850113cbdeb9a4535c439e2f67f782739
1
// PR c++/77591
2
// { dg-do compile { target c++14 } }
3
// { dg-options "-O0 -Wreturn-local-addr" }
4
5
class A { };
6
7
decltype(auto)
8
foo ()
9
{
10
A c; // { dg-warning "reference to local variable 'c' returned" }
11
return (c);
12
}
13
14
decltype(auto)
15
bar ()
16
{
17
A c; // { dg-warning "reference to local variable 'c' returned" }
18
return 1==1 ? c : c;
19
}