URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do run }
|
// { dg-do run }
|
// PRMS Id: 4697
|
// PRMS Id: 4697
|
// Bug: g++ calls the non-const method for a const object.
|
// Bug: g++ calls the non-const method for a const object.
|
|
|
class A {
|
class A {
|
public:
|
public:
|
void foo(int &i) const { i = 0; }
|
void foo(int &i) const { i = 0; }
|
void foo(int &i) { i = 1; }
|
void foo(int &i) { i = 1; }
|
};
|
};
|
|
|
int main()
|
int main()
|
{
|
{
|
A a;
|
A a;
|
const A& b = a;
|
const A& b = a;
|
int i = 2;
|
int i = 2;
|
b.foo (i);
|
b.foo (i);
|
return i;
|
return i;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.