Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/constexpr-77771.C

raw
1 // PR c++/77771
2 // { dg-do compile { target c++11 } }
3 // { dg-options "-O" }
4
5 struct S
6 {
7 char x[2];
8 unsigned y;
9 };
10
11 constexpr bool func(const S s)
12 {
13 return s.x[0] != 42 || s.x[1] != 0;
14 }
15
16 static_assert(func({{42, 7}, 0}), "");