Thread View: gnu.g++.bug
1 messages
1 total messages
Started by Dean R. E. Long
Sat, 23 Jan 1993 02:45
g++ 2.3.3 const non-warning
Author: Dean R. E. Long
Date: Sat, 23 Jan 1993 02:45
Date: Sat, 23 Jan 1993 02:45
21 lines
804 bytes
804 bytes
I would expect g++ to give me a warning for calling a non-const
member function with a const object in the following, but it does not:
class B {
int x;
public:
void foo(void) { x = 1; }
};
class A {
B *p;
public:
A() { p = 0; }
const B & ro() { return *p; }
};
main()
{
A a;
a.ro().foo(); // warn me, please!
}
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads