summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp0x/initlist21.C
blob: 9412a0851708d308c7fdb30b76d7869731a5b595 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// PR c++/40689
// { dg-options "-std=c++0x" }

class X
{
 public:
  X(): data {1,2} {} // { dg-error "too many initializers" }
 private:
  const short data[1];
};

int f(int n)
{
  const float * pData = new const float[1] { 1.5, 2.5 }; // { dg-error "too many initializers" }
  pData = new const float[n] { 1.5, 2.5 }; // { dg-warning "array size" }

  return 0;
}