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
Add __builtion_unreachable to vector::size(), vector::capacity()
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
constexpr-loop4.C
blob
67f7cfa1d1d689e794633c40c197ba9d8b18c884
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[5] = { 6, 7, 8, 9, 10 };
11
A *ap = ar;
12
int i = 0, j = 0;
13
for (j = 0; j < 2; j++)
14
{
15
do
16
*ap++ = A{i};
17
while (++i < j * 2 + 2);
18
}
19
return (ar[0].i == 0
20
&& ar[1].i == 1
21
&& ar[2].i == 2
22
&& ar[3].i == 3
23
&& ar[4].i == 10);
24
}
25
26
#define SA(X) static_assert((X),#X)
27
SA(f());