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
Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git]
/
old-autovect-branch
/
gcc
/
testsuite
/
g++.dg
/
init
/
aggr2.C
blob
97dbeb6190b80da608ce80ab9cf7369c6aa7278f
1
// PR c++/15172
2
// { dg-do run }
3
4
extern "C" int printf (const char *, ...);
5
extern "C" void abort ();
6
7
struct A {
8
static A* p;
9
10
A() { p = this; }
11
A(const A&);
12
~A() { if (this != p) abort (); }
13
void print () { }
14
};
15
16
A* A::p;
17
18
struct B {
19
A a;
20
};
21
22
B b = { A () };
23
24
struct A2 {
25
static A2* p;
26
27
A2() { p = this; }
28
A2(const A2&);
29
~A2() { if (this != p) abort (); }
30
void print () { }
31
};
32
33
A2* A2::p;
34
35
struct B2 {
36
A2 a2;
37
};
38
39
int main () {
40
b.a.print ();
41
{
42
B2 b2 = { A2() };
43
b2.a2.print ();
44
}
45
}
46