summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/constexpr-array8.C
blob: f4aae4f58d9f09260870a049a2ef56ef0bb0574b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// { dg-do run { target c++11 } }

struct A { int i,j; };

struct X {
  A a = {1,1};
};

constexpr X table[2][2] = {{ {} }};

#define SA(X) static_assert(X,#X)
SA(table[1][1].a.i == 1);

extern "C" void abort();

const int *p = &table[1][1].a.j;

int main()
{
  if (*p != 1)
    abort();
}