New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DataFormats/TrackerRecHit2D: Fix warning warning: 'class TkCloner' has virtual functions and accessible non-virtual destructor [-Wnon-virtual-dtor] #18927
DataFormats/TrackerRecHit2D: Fix warning warning: 'class TkCloner' has virtual functions and accessible non-virtual destructor [-Wnon-virtual-dtor] #18927
Conversation
A new Pull Request was created by @gartung (Patrick Gartung) for master. It involves the following packages: DataFormats/TrackerRecHit2D @perrotta, @cmsbuild, @slava77, @davidlange6 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
Please test |
The tests are being triggered in jenkins. |
Could you stop adding virtual destructor to classes whose instances are never deleted through a base class pointer? C++ is a language for those who know what they are doing, we should teach rules, not impose random syntax rules. |
-1 Tested at: e8f5250 You can see the results of the tests here: I found follow errors while testing this PR Failed tests: UnitTests RelVals AddOn
I found errors in the following unit tests: ---> test testRecoMETMETProducers had ERRORS
When I ran the RelVals I found an error in the following worklfows: runTheMatrix-results/4.53_RunPhoton2012B+RunPhoton2012B+HLTD+RECODR1reHLT+HARVESTDR1reHLT/step2_RunPhoton2012B+RunPhoton2012B+HLTD+RECODR1reHLT+HARVESTDR1reHLT.log136.731 step2 runTheMatrix-results/136.731_RunSinglePh2016B+RunSinglePh2016B+HLTDR2_2016+RECODR2_2016reHLT_skimSinglePh_HIPM+HARVESTDR2/step2_RunSinglePh2016B+RunSinglePh2016B+HLTDR2_2016+RECODR2_2016reHLT_skimSinglePh_HIPM+HARVESTDR2.log
I found errors in the following addon tests: cmsDriver.py RelVal -s L1REPACK:Full --data --scenario=pp -n 10 --conditions auto:run2_hlt_PRef --relval 9000,50 --datatier "RAW" --customise=HLTrigger/Configuration/CustomConfigs.L1T --era Run2_2017 --magField 38T_PostLS1 --eventcontent RAW --fileout file:RelVal_Raw_PRef_DATA.root --filein /store/data/Run2016B/JetHT/RAW/v1/000/272/762/00000/C666CDE2-E013-E611-B15A-02163E011DBE.root : FAILED - time: date Thu May 25 09:28:08 2017-date Thu May 25 09:18:46 2017 s - exit: 23552 |
Comparison not run due to runTheMatrix errors (RelVals and Igprof tests were also skipped) |
@VinInn I asked for Patrick to do these changes. The gcc7 build has thousands of warnings stemming from base classes not declaring virtual destructors. In addition, CMS coding standards do say that one should declare a virtual destructor for all classes used as base classes. I understand that the way one uses a class now may not require a virtual destructor, but if someone changes the use (say holds a |
There are specific cases where this is not required and actually causes measurable performance degradation. This is NOT one of those, I agree (still please fix the grammar). |
…nctions and accessible non-virtual destructor [-Wnon-virtual-dtor]
Pull request #18927 was updated. @perrotta, @cmsbuild, @slava77, @davidlange6 can you please check and sign again. |
It this OK? |
@@ -18,6 +18,7 @@ class TkCloner { | |||
return hit.clone(*this, tsos); | |||
} | |||
|
|||
virtual ~TkCloner() {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better... thanks.
I initiall had |
please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
+1
|
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request requires discussion in the ORP meeting before it's merged. @davidlange6, @smuzaffar |
+1 |
This gcc 7.0.0 warning appears throughout the build log.
DataFormats/TrackerRecHit2D/interface/TkCloner.h:15:7: warning: 'class TkCloner' has virtual functions and accessible non-virtual destructor [-Wnon-virtual-dtor]
Fixed by adding virtual destructor for TkCloner.