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
/cp
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
constexpr-loop2.C
blob
2e53e4831d3d6d3a36483024c28f3cedbf95bdd8
1
// { dg-do compile { target c++14 } }
2
3
constexpr int f(int* p) { return *p; }
4
constexpr int g(int n)
5
{
6
int sum = 0;
7
for (int i = 1; i <= n; ++i)
8
sum += f(&i);
9
return sum;
10
}
11
12
static_assert(g(3) == 3+2+1,"");