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
libstdc++: remove JSON comment.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.jason
/
new4.C
blob
d09ca1453cc5d4fa870e6e5171c551282bc51f64
1
// { dg-do run }
2
// { dg-options "-fcheck-new" }
3
4
struct A {
5
A(): i(42) { }
6
A(int j): i(j) { }
7
int i;
8
};
9
10
A* ap = new A (1);
11
A* ap2 = new A[3];
12
13
int
14
main ()
15
{
16
if (ap->i != 1 || ap2[0].i != 42 || ap2[1].i != 42 || ap2[2].i != 42)
17
return 1;
18
19
A* ap = new A (1);
20
A* ap2 = new A[3];
21
22
if (ap->i != 1 || ap2[0].i != 42 || ap2[1].i != 42 || ap2[2].i != 42)
23
return 1;
24
25
return 0;
26
}