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
* auto-profile.c (afdo_annotate_cfg): Use update_max_bb_count.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
lambda-deduce-mult.C
blob
f1c7ba9482594a69c2bb775a06f5df1d552b3d73
1
// Testcase for an extension to allow return type deduction when the lambda
2
// contains more than just a single return-statement.
3
4
// { dg-do run { target c++14 } }
5
6
bool b;
7
template <class T>
8
T f (T t)
9
{
10
return [=] {
11
auto i = t+1;
12
if (b)
13
return i+1;
14
else
15
return i+1;
16
}();
17
}
18
19
int main()
20
{
21
// Pointless, but well-formed.
22
[] { return 1; return 2; }();
23
24
if (f(1) != 3)
25
return 1;
26
}