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
[31/77] Use scalar_int_mode for move2add
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.mike
/
p2394.C
blob
6581f9f2f88c02a31fe4f26ae0bdc7bbb1f80db7
1
// { dg-do run }
2
// prms-id: 2394
3
4
class Foo {
5
public:
6
int x;
7
int y;
8
Foo(int i, int j) { x = i; y = j; }
9
} foo(10, 11);
10
11
class Wasted { int unsed; };
12
13
class Bar : Wasted, public Foo {
14
public:
15
Bar() : Foo(12, 13) { }
16
} bar;
17
18
int
19
test0() {
20
int Foo::* pmi = &Foo::y;
21
return (int)(foo.*pmi);
22
}
23
24
int
25
test1() {
26
int Foo::* pmi = &Foo::y;
27
return (int)(bar.*pmi);
28
}
29
30
int
31
main() {
32
if (test0() != 11)
33
return 1;
34
if (test1() != 13)
35
return 2;
36
return 0;
37
}