Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp1y/constexpr-loop3.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 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()); |