Aloush154 / bullet

Automatically exported from code.google.com/p/bullet
Other
0 stars 0 forks source link

Fix hidden overloaded methods #693

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Compiling an application using bullet with clang results in 
-Woverloaded-virtual warning messages in btConvexHullShape.h:

In file included from lib/ephysics/ephysics_constraints.cpp:5:
In file included from ../src/lib/ephysics/ephysics_private.h:16:
In file included from /usr/include/bullet/btBulletDynamicsCommon.h:20:
In file included from /usr/include/bullet/btBulletCollisionCommon.h:32:
/usr/include/bullet/BulletCollision/CollisionShapes/btConvexHullShape.h:76:15: 
warning: 
      'btConvexHullShape::project' hides overloaded virtual function [-Woverloaded-virtual]
        virtual void project(const btTransform& trans, const btVector3& dir, btScalar&...
                     ^
/usr/include/bullet/BulletCollision/CollisionShapes/btConvexShape.h:55:15: 
note: hidden overloaded
      virtual function 'btConvexShape::project' declared here
        virtual void project(const btTransform& trans, const btVector3& dir, btScalar& min,...

The reason is that the compiler stops searching for methods in the parent class 
if it find any method with the same name defined in the child, as explained in:

http://stackoverflow.com/questions/585913/c-member-function-virtual-override-and
-overload-at-the-same-time

Importing the parent declarations solves the problem. Example patch is attached.

bullet 2.81, Arch Linux amd64

Original issue reported on code.google.com by hda...@gmail.com on 29 Jan 2013 at 12:29

Attachments:

GoogleCodeExporter commented 8 years ago
good find, we'll fix it before next release

Original comment by erwin.coumans on 31 Jan 2013 at 8:33

GoogleCodeExporter commented 8 years ago
https://github.com/bulletphysics/bullet3/issues/103

Original comment by erwin.coumans on 30 Mar 2014 at 6:22