aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/initlist49.C
blob: 0fa4e3f33437162996551ccd6ca563c53ae154d4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Test for non-trivial list-initialization with array new.
// { dg-do run { target c++11 } }

struct A
{
  enum E { c_string, number } e;
  A(const char *): e(c_string) {}
  A(int): e(number) {}
};

int main()
{
  A* ap = new A[2]{1, ""};
  if (ap[0].e != A::number || ap[1].e != A::c_string)
    return 1;
  delete[] ap;
}