GCC -- Warning when a non-virtual function is overridden?

I

Ignoramus534

Does g++ provide any sorts of warnings when a non-virtual function is
overridden? I know that it is a legal thing to do in C++, but for us
it is always a wrong thing to do.

Example

class Parent {
public:
void f();
};

class Child : public Parent {
public:
void f(); // I want a WARNING here!!!
};


thanks

i
 
V

Victor Bazarov

Ignoramus534 said:
Does g++ provide any sorts of warnings when a non-virtual function is
overridden?

g++ has a newsgroup dedicated to it, gnu.g++.help. Please ask there.
Warnings are not regulated by the language Standard. Neither are any
compiler command-line switches.

V
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,187
Members
46,728
Latest member
FernMcmull

Latest Threads

Top