OSDN Git Service

* init.c (decl_constant_value): Deal with COND_EXPR specially.
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / expr / anew2.C
1 // { dg-do run }
2 // PR 11228: array operator new, with zero-initialization and a variable sized array.
3 // Regression test for PR 
4 // Author: Matt Austern <austern@apple.com>
5
6
7 double* allocate(int n)
8 {
9   return new double[n]();
10 }
11
12 int main()
13 {
14   const int n = 17;
15   double* p = allocate(n);
16   for (int i = 0; i < n; ++i)
17     if (p[i] != 0.0)
18       return 1;
19   return 0;
20 }