repo.or.cz
/
netbsd-mini2440.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
No empty .Rs/.Re
[netbsd-mini2440.git]
/
gnu
/
dist
/
gcc4
/
gcc
/
testsuite
/
g++.dg
/
other
/
init2.C
blob
0b85aa67d0ac03396e7f2109c39f93efd79d0004
1
// { dg-do run }
2
3
// Copyright (C) 2001 Free Software Foundation, Inc.
4
// Contributed by Nathan Sidwell 20 Dec 2001 <nathan@nathan@codesourcery.com>
5
6
// PR 160. Wrong code emitted for some reference initializers.
7
8
void Foo ()
9
{
10
}
11
12
int fail;
13
14
class C
15
{
16
public:
17
int m;
18
int &r;
19
20
C () ;
21
};
22
23
C::C ()
24
: m (1), r ((Foo (), m))
25
{
26
m = 10;
27
28
if (r != m)
29
fail = 1;
30
else if (&m != &r)
31
fail = 2;
32
}
33
int main ()
34
{
35
int m (1);
36
int &r ((Foo (),m));
37
38
m = 10;
39
if (r != m)
40
fail = 3;
41
else if (&r != &m)
42
fail = 4;
43
44
if (!fail)
45
{
46
C c;
47
}
48
return fail;
49
}