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
2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1z
/
constexpr-lambda22.C
blob
fcb6ff96d588a4c2eda6e31b791b009b0509e491
1
// { dg-do compile }
2
// { dg-options -std=c++17 }
3
4
#define SA(X) static_assert((X),#X)
5
6
template<typename>
7
constexpr int
8
foo ()
9
{
10
constexpr int a[] = { 1, 2, 3, 4, 5 };
11
int i = 0;
12
auto j = [&] {
13
for (auto x : a)
14
i++;
15
return i;
16
}();
17
return j;
18
}
19
20
SA (foo<int>() == 5);