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

Discussion in 'C++' started by Ignoramus534, Oct 12, 2006.

  1. Ignoramus534

    Ignoramus534 Guest

    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
     
    Ignoramus534, Oct 12, 2006
    #1
    1. Advertising

  2. Ignoramus534 wrote:
    > 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
    --
    Please remove capital 'A's when replying by e-mail
    I do not respond to top-posted replies, please don't ask
     
    Victor Bazarov, Oct 12, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bj?rn Toft Madsen
    Replies:
    2
    Views:
    3,553
    Heinz Ozwirk
    Mar 2, 2004
  2. S. I. Becker
    Replies:
    11
    Views:
    541
    Earl Purple
    Jun 14, 2006
  3. Replies:
    11
    Views:
    698
    James Kanze
    Sep 10, 2006
  4. archimed7592
    Replies:
    4
    Views:
    746
    =?UTF-8?B?UGF3ZcWC?=
    May 30, 2007
  5. wink
    Replies:
    4
    Views:
    1,183
Loading...

Share This Page