Running the code below in g++ will result the following error:
error: passing 'const A' as 'this' argument discards qualifiers [-fpermissive]
struct A{
void f(){};
};
int main(){
const A a;
a.f();
return 0;
}
Where do we use this?
fpermissive implies that the code is non-conformant. Where does the standard states that this is an error?