Why this is compiled without warning?
struct A{
virtual void get(int const x) = 0;
};
struct B : public A{
virtual void get(int x) override{
}
};
int main(int argc, char *argv[]){
B b;
b.get(6);
return 0;
}
Here is the output:
g++ -std=c++11 -Wall ./x.cc
clang -std=c++11 -Wall ./x.cc -lstdc++
If I add -Wextra
I get messages for unused function parameters, but still nothing about the const.