Sign in
gnu
/
gcc
/
1f16a020acbea0af26209478990b83b1a1ba3a2b
/
.
/
gcc
/
testsuite
/
g++.old-deja
/
g++.jason
/
overload11.C
blob: 3fe871918852e246aed26c9bf6e8b7f7d570cd4f [
file
] [
log
] [
blame
]
// { dg-do run }
// 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
;
}