aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-union4.C
blob: a8d6b8d3ea69382cafca807f1678eecad3ed885a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// PR c++/54922
// { dg-do compile { target c++11 } }

struct nullable_int
{
  bool init_;
  union {
    unsigned char for_value_init;
    int value_;
  };

  constexpr nullable_int() : init_(false), for_value_init() {}
};

#define SA(X) static_assert(X,#X)

constexpr nullable_int n;
SA((n.for_value_init == 0));