-Woverloaded-virtual - warnings

Issue #24 resolved
Samir Menon repo owner created an issue

http://stackoverflow.com/questions/9995421/gcc-woverloaded-virtual-warnings

The warning means that: When you are not using dynamic dispatch then your derived class object can only call,

void exception()
and it will hide all same named methods of the Base class intermediate.

In order that your derived class object can call all the same named methods in base class intermediate, You need to add the following line to your derived class.

using intermediate::exception; Ofcourse, You are in best position to decide if this is a problem or not.

Comments (10)

  1. Robert Katzschmann

    These are all the 6 warnings realted to this issue

    Description Resource Path Location Type 'scl::SGcController::init' hides overloaded virtual function [-Woverloaded-virtual] SGcController.hpp /scl-manips-group.git/src/scl/control/gc/data_structs line 78 C/C++ Problem 'sutil::CMappedMultiLevelList<std::basic_string<char>, scl::STaskBase *>::create' hides overloaded virtual functions [-Woverloaded-virtual] CMappedMultiLevelList.hpp /scl-manips-group.git/3rdparty/sUtil/src/sutil line 60 C/C++ Problem 'sutil::CMappedMultiLevelList<std::basic_string<char>, scl::STaskBase *>::create' hides overloaded virtual functions [-Woverloaded-virtual] CMappedMultiLevelList.hpp /scl-manips-group.git/3rdparty/sUtil/src/sutil line 65 C/C++ Problem 'sutil::CMappedMultiLevelList<std::basic_string<char>, scl::STaskBase *>::deepCopy' hides overloaded virtual function [-Woverloaded-virtual] CMappedMultiLevelList.hpp /scl-manips-group.git/3rdparty/sUtil/src/sutil line 70 C/C++ Problem 'sutil::CMappedTree<std::basic_string<char>, scl::SGraphicsPhysicalLink>::deepCopy' hides overloaded virtual function [-Woverloaded-virtual] CMappedTree.hpp /scl-manips-group.git/3rdparty/sUtil/src/sutil line 82 C/C++ Problem 'sutil::CMappedTree<std::basic_string<char>, scl::SRobotLink>::deepCopy' hides overloaded virtual function [-Woverloaded-virtual] CMappedTree.hpp /scl-manips-group.git/3rdparty/sUtil/src/sutil line 82 C/C++ Problem

  2. Robert Katzschmann

    slows down the eclipse build process and debugging the own code becomes annoying after a while...

  3. Samir Menon reporter

    Workaround : Remove -Wall from the compiler options on macs. (This is not part of wall on Linux).

  4. Samir Menon reporter

    This is a fairly involved issue. Primarily affects classes where the subclass actually extends the superclass, and the superclass' functions just "don't" work for the subclass.

    Ie. The subclass functions must be overloaded.

    There are two possible fixes:

    • Make sure the overloadable functions are not virtual (probably the way to go)
    • Make the overloadable functions private/protected in the subclasses

    Need some more investigation to see which method will work best.

  5. Log in to comment