Sign in
gnu
/
gcc
/
e8cbc2e256b3e9568288594d9f90a2015d31b55a
/
.
/
gcc
/
testsuite
/
g++.old-deja
/
g++.jason
/
overload11.C
blob: f5ed01ef1b46bcd5dbab46cceb9c888a1c25f3b5 [
file
] [
log
] [
blame
]
// PRMS Id: 4697
// Bug: g++ calls the non-const method for a const object.
class
A
{
public
:
void
foo
(
int
&
i
)
const
{
i
=
0
;
}
void
foo
(
int
&
i
)
{
i
=
1
;
}
};
int
main
()
{
A a
;
const
A
&
b
=
a
;
int
i
=
2
;
b
.
foo
(
i
);
return
i
;
}