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
/
constexpr-loop3.C
blob
5e7c3c97dc2dbe07f83390789607b88848cc4641
1
// { dg-do compile { target c++14 } }
2
3
struct A
4
{
5
int i;
6
};
7
8
constexpr bool f()
9
{
10
A ar[4] = { 1, 2, 3, 4 };
11
A *ap = ar;
12
int i = 0;
13
do
14
*ap++ = A{i};
15
while (++i < 3);
16
return (ar[0].i == 0
17
&& ar[1].i == 1
18
&& ar[2].i == 2
19
&& ar[3].i == 4);
20
}
21
22
#define SA(X) static_assert((X),#X)
23
SA(f());