repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
expr
/
anew3.C
blob
3223546d4c8da8f780f76b3a964c847e8aa7c04b
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
struct X
7
{
8
int a;
9
double b;
10
};
11
12
X* allocate(int n)
13
{
14
return new X[n]();
15
}
16
17
int main()
18
{
19
const int n = 17;
20
X* p = allocate(n);
21
for (int i = 0; i < n; ++i)
22
if (p[i].a != 0 || p[i].b != 0.0)
23
return 1;
24
return 0;
25
}