prog.cpp: In member function 'void A::f() const':
prog.cpp:10:9: error: increment of member 'A::member' in read-only object
member++; // Won't work (modifiying this->member)
^
prog.cpp:11:5: error: passing 'const A' as 'this' argument discards qualifiers [-fpermissive]
g(); // Won't work (g() is not const)
^
prog.cpp:14:7: note: in call to 'void A::g()'
void g()
^
prog.cpp: In function 'int main()':
prog.cpp:32:6: error: passing 'const A' as 'this' argument discards qualifiers [-fpermissive]
b.g(); // Won't work : g() isn't const and might modify b;
^
prog.cpp:14:7: note: in call to 'void A::g()'
void g()
^