Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/cpp0x/constexpr-array9.C @ 152:2b5abeee2509
update gcc11
author | anatofuz |
---|---|
date | Mon, 25 May 2020 07:50:57 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 1 // { dg-do run { target c++11 } } |
2 | |
3 struct A { int i,j; }; | |
4 | |
5 struct X { | |
6 A a = {0,0}; | |
7 }; | |
8 | |
9 constexpr X table[2][2] = {{ {} }}; | |
10 | |
11 #define SA(X) static_assert(X,#X) | |
12 SA(table[1][1].a.i == 0); | |
13 | |
14 extern "C" void abort(); | |
15 | |
16 const int *p = &table[1][1].a.j; | |
17 | |
18 int main() | |
19 { | |
20 if (*p != 0) | |
21 abort(); | |
22 } |