131
|
1 // PR c++/84463
|
|
2 // { dg-do compile { target c++11 } }
|
|
3
|
|
4 struct S { int r; const unsigned char s[5]; };
|
|
5 static constexpr S a[] = { { 0, "abcd" } };
|
|
6 struct T { const unsigned char s[5]; };
|
|
7 static constexpr T b[] = { { "abcd" } };
|
|
8
|
|
9 constexpr int
|
|
10 foo (const unsigned char *x)
|
|
11 {
|
|
12 return x[0];
|
|
13 }
|
|
14
|
|
15 constexpr static const S *j = &a[0];
|
|
16 constexpr static const int k = j->s[0];
|
|
17 constexpr static int l = foo (a[0].s);
|
|
18 constexpr static int m = foo (j->s);
|
|
19 constexpr static const T *n = &b[0];
|
|
20 constexpr static const int o = n->s[0];
|
|
21 constexpr static int p = foo (b[0].s);
|
|
22 constexpr static int q = foo (n->s);
|