View Issue Details

IDProjectCategoryView StatusLast Update
0025076CommunityOCCT:Codingpublic2016-04-20 15:50
ReporterEpy Assigned Toabv  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
PlatformLinux 32-bitOSLubuntu 
Product Version6.7.1 
Target Version7.0.0Fixed in Version7.0.0 
Summary0025076: Hidden overloaded virtual functions
DescriptionWhen compiling with GCC or Clang with (-Woverloaded-virtual), there are a lot of warnings, for example:

In file included from test_2.cxx:16:
/usr/include/oce/BRepOffsetAPI_MakePipeShell.hxx:156:28: warning:
      'BRepOffsetAPI_MakePipeShell::Delete' hides overloaded virtual function
      [-Woverloaded-virtual]
  Standard_EXPORT void Delete(const TopoDS_Shape& Profile) ;
                           ^
/usr/include/oce/BRepBuilderAPI_MakeShape.hxx:47:35: note: hidden overloaded
      virtual function 'BRepBuilderAPI_MakeShape::Delete' declared here:
      different number of parameters (0 vs 1)
  Standard_EXPORT virtual void Delete() ;
                                  ^
1 warning generated.

Are these intentional? If so, then this can be closed.
Steps To ReproduceCompile with CLang
TagsNo tags attached.
Test case number

Relationships

related to 0025411 closedbugmaster Open CASCADE BVH package - eliminate warning about hidden overloaded method ::Box 
parent of 0027065 closedabv Open CASCADE BRepOffsetAPI_MakePipe misses definition of virtual method Generated() 
parent of 0027047 closedabv Open CASCADE STEP -- eliminate useless polymorhic methods Init() 
parent of 0027058 closedabv Open CASCADE AIS_ColorScale defines methods SetColor and SetWidth hiding inherited methods 
parent of 0027066 closedbugmaster Open CASCADE BRepFeat_MakeCylindricalHole::Perform() hides overloaded virtual function 
related to 0027067 closedabv Open CASCADE Avoid use of virtual methods for implementation of destructors in legacy classes 
related to 0026990 closedabv Open CASCADE Compiler warnings in LDOM_OSStream.hxx 

Activities

abv

2014-07-14 09:46

manager   ~0030106

Most overloads are intentional, but it may happen that same occurrences are wrong, to be checked. In any case, something should be done to silence the warnings.

git

2016-01-08 20:09

administrator   ~0049732

Branch CR25076 has been created by abv.

SHA-1: 533d1a62fdfefec5352c8a56ef2c66884ae2ca09


Detailed log of new commits:

Author: abv
Date: Tue Dec 29 07:07:17 2015 +0300

    0025076: Hidden overloaded virtual functions
    
    Implementation of virtual functions is made more consistent in places where warning was issued:
    
    - Missing implementation of virtual method Closed() added in classes inheriting Intf_Polygon2d
    - Empty implementation of virtual method Read() accepting stream is moved from PCDM_RetrievalDriver to StdLDrivers_DocumentRetrievalDriver
    - Method BRepFill::Delete() is renamed to DeleteProfile() to avoid confusion with method Delete() inherited from MMgt_TShared
    - Virtual method AIS_Dimenaion::ComputePlane() is removed from base class; each dimension defines and uses its own method with the same name (but different arguments)
    - Inherited virtual method Dump() with single argument in class XCAFDoc_ShapeTool is now defined as short-cut to own method Dump(), also calling parent's one
    - Inherited virtual method BoundingBox(void) is made visible in AIS_Shape
    - Inherited virtual method Box(void) is made visible in classes inheriting BVH_PrimitiveSet

abv

2016-01-08 20:11

manager   ~0049733

Some cases are separated into children and related issues; fix for remaining ones is pushed to CR25076. Please review

kgv

2016-01-08 20:43

developer   ~0049739

Please test the patch.

Epy

2016-01-20 06:38

developer   ~0049955

These warnings are still present in the 7.0.0 beta source tarball.

abv

2016-01-20 09:30

manager   ~0049957

Hello Jacob, yes these warnings are present in 7.0.0.beta, but should be fixed (except one, see ) in master, integrated on January 15th. Can you check this on your side?

Epy

2016-01-20 09:40

developer   ~0049958

Yes, I can check this once I have git access. I was unable to find the SSH keys section in the "My Account" section on dev.opencascade.org (I posted to the forum for help with this).

Epy

2016-01-22 22:59

developer   ~0050088

I get the following on master as of an hour ago:

In file included from /home/jake/occt/src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.cxx:19:
In file included from /home/jake/occt/build/inc/BRepOffsetAPI_MakePipe.hxx:1:
/home/jake/occt/src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.hxx:82:32: warning: 'BRepOffsetAPI_MakePipe::Generated' hides overloaded virtual function [-Woverloaded-virtual]
  Standard_EXPORT TopoDS_Shape Generated (const TopoDS_Shape& SSpine, const TopoDS_Shape& SProfile);
                               ^
/home/jake/occt/src/BRepBuilderAPI/BRepBuilderAPI_MakeShape.hxx:54:55: note: hidden overloaded virtual function 'BRepBuilderAPI_MakeShape::Generated' declared here: different number of parameters (1 vs 2)
  Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S);
                                                      ^
1 warning generated.
In file included from /home/jake/occt/src/BRepTest/BRepTest_SweepCommands.cxx:27:
In file included from /home/jake/occt/build/inc/BRepOffsetAPI_MakePipe.hxx:1:
/home/jake/occt/src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.hxx:82:32: warning: 'BRepOffsetAPI_MakePipe::Generated' hides overloaded virtual function [-Woverloaded-virtual]
  Standard_EXPORT TopoDS_Shape Generated (const TopoDS_Shape& SSpine, const TopoDS_Shape& SProfile);
                               ^
/home/jake/occt/src/BRepBuilderAPI/BRepBuilderAPI_MakeShape.hxx:54:55: note: hidden overloaded virtual function 'BRepBuilderAPI_MakeShape::Generated' declared here: different number of parameters (1 vs 2)
  Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S);
                                                      ^
1 warning generated.
In file included from /home/jake/occt/src/QABugs/QABugs_19.cxx:52:
In file included from /home/jake/occt/build/inc/BRepOffsetAPI_MakePipe.hxx:1:
/home/jake/occt/src/BRepOffsetAPI/BRepOffsetAPI_MakePipe.hxx:82:32: warning: 'BRepOffsetAPI_MakePipe::Generated' hides overloaded virtual function [-Woverloaded-virtual]
  Standard_EXPORT TopoDS_Shape Generated (const TopoDS_Shape& SSpine, const TopoDS_Shape& SProfile);
                               ^
/home/jake/occt/src/BRepBuilderAPI/BRepBuilderAPI_MakeShape.hxx:54:55: note: hidden overloaded virtual function 'BRepBuilderAPI_MakeShape::Generated' declared here: different number of parameters (1 vs 2)
  Standard_EXPORT virtual const TopTools_ListOfShape& Generated (const TopoDS_Shape& S);
                                                      ^
1 warning generated.

Epy

2016-01-22 23:00

developer   ~0050089

I should add that these were the only 3 warnings I got when compiling with -Wall on Clang, which is fantastic.

abv

2016-01-23 09:19

manager   ~0050091

Yes, this remaining warning is subject of 0027065; it is separated because that particular case needs to be investigated more carefully

git

2016-04-17 13:46

administrator   ~0052937

Branch CR25076 has been deleted by kgv.

SHA-1: 533d1a62fdfefec5352c8a56ef2c66884ae2ca09

Related Changesets

occt: master 201c2208

2015-12-29 04:07:17

abv


Committer: abv Details Diff
0025076: Hidden overloaded virtual functions

Implementation of virtual functions is made more consistent in places where warning was issued:

- Missing implementation of virtual method Closed() added in classes inheriting Intf_Polygon2d
- Empty implementation of virtual method Read() accepting stream is moved from PCDM_RetrievalDriver to StdLDrivers_DocumentRetrievalDriver
- Method BRepFill::Delete() is renamed to DeleteProfile() to avoid confusion with method Delete() inherited from MMgt_TShared
- Virtual method AIS_Dimenaion::ComputePlane() is removed from base class; each dimension defines and uses its own method with the same name (but different arguments)
- Inherited virtual method Dump() with single argument in class XCAFDoc_ShapeTool is now defined as short-cut to own method Dump(), also calling parent's one
- Inherited virtual method BoundingBox(void) is made visible in AIS_Shape
- Inherited virtual method Box(void) is made visible in classes inheriting BVH_PrimitiveSet
Affected Issues
0025076
mod - src/AIS/AIS_AngleDimension.hxx Diff File
mod - src/AIS/AIS_DiameterDimension.hxx Diff File
mod - src/AIS/AIS_Dimension.hxx Diff File
mod - src/AIS/AIS_RadiusDimension.hxx Diff File
mod - src/AIS/AIS_Shape.hxx Diff File
mod - src/BRepExtrema/BRepExtrema_TriangleSet.hxx Diff File
mod - src/BRepFill/BRepFill_PipeShell.cxx Diff File
mod - src/BRepFill/BRepFill_PipeShell.hxx Diff File
mod - src/BRepOffsetAPI/BRepOffsetAPI_MakePipeShell.cxx Diff File
mod - src/Geom2dInt/Geom2dInt_ThePolygon2dOfTheIntPCurvePCurveOfGInter.hxx Diff File
mod - src/HLRBRep/HLRBRep_ThePolygon2dOfTheIntPCurvePCurveOfCInter.hxx Diff File
mod - src/PCDM/PCDM_RetrievalDriver.cxx Diff File
mod - src/PCDM/PCDM_RetrievalDriver.hxx Diff File
mod - src/Select3D/Select3D_BVHPrimitiveContent.hxx Diff File
mod - src/SelectMgr/SelectMgr_SelectableObjectSet.hxx Diff File
mod - src/SelectMgr/SelectMgr_SensitiveEntitySet.hxx Diff File
mod - src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.cxx Diff File
mod - src/StdLDrivers/StdLDrivers_DocumentRetrievalDriver.hxx Diff File
mod - src/XCAFDoc/XCAFDoc_ShapeTool.cxx Diff File
mod - src/XCAFDoc/XCAFDoc_ShapeTool.hxx Diff File

Issue History

Date Modified Username Field Change
2014-07-13 00:17 Epy New Issue
2014-07-13 00:17 Epy Assigned To => kgv
2014-07-14 09:46 abv Note Added: 0030106
2014-09-11 19:15 abv Target Version => 7.0.0
2014-11-12 08:04 kgv Relationship added related to 0025411
2016-01-08 19:11 abv Relationship added parent of 0027065
2016-01-08 19:11 abv Assigned To kgv => abv
2016-01-08 19:11 abv Status new => assigned
2016-01-08 19:12 abv Relationship added parent of 0027047
2016-01-08 19:12 abv Relationship added parent of 0027058
2016-01-08 19:46 abv Relationship added parent of 0027066
2016-01-08 19:55 abv Relationship added related to 0027067
2016-01-08 20:09 git Note Added: 0049732
2016-01-08 20:11 abv Note Added: 0049733
2016-01-08 20:11 abv Assigned To abv => kgv
2016-01-08 20:11 abv Status assigned => resolved
2016-01-08 20:11 abv Steps to Reproduce Updated
2016-01-08 20:43 kgv Note Added: 0049739
2016-01-08 20:43 kgv Assigned To kgv => bugmaster
2016-01-08 20:43 kgv Status resolved => reviewed
2016-01-09 14:41 abv Relationship added related to 0026990
2016-01-15 16:57 abv Changeset attached => occt master 201c2208
2016-01-15 16:57 abv Assigned To bugmaster => abv
2016-01-15 16:57 abv Status reviewed => verified
2016-01-15 16:57 abv Resolution open => fixed
2016-01-20 06:38 Epy Note Added: 0049955
2016-01-20 09:30 abv Note Added: 0049957
2016-01-20 09:40 Epy Note Added: 0049958
2016-01-22 22:59 Epy Note Added: 0050088
2016-01-22 23:00 Epy Note Added: 0050089
2016-01-23 09:19 abv Note Added: 0050091
2016-04-17 13:46 git Note Added: 0052937
2016-04-20 15:43 aiv Fixed in Version => 7.0.0
2016-04-20 15:50 aiv Status verified => closed