From 43def1466eb7138c1dd997c0a6bc2b591765edb3 Mon Sep 17 00:00:00 2001 From: Dmitri Smirnov Date: Tue, 7 Nov 2023 12:22:32 -0500 Subject: [PATCH] fix: redefine overloaded virtual methods in derived class (#625) Compiler errors due to hidden virtual method appear when building the code against ROOT6.24 ``` g++ -m64 -fPIC -pipe -Wall -Woverloaded-virtual -std=c++0x -Wno-long-long -pthread -Werror -O2 -g -falign-loops -falign-jumps -falign-functions -Dsl79_gcc485 -D__ROOT__ -DNEW_DAQ_READER -I. -IStRoot -I.sl79_gcc485/include -I/star/ROOT/6.24.06/geant3/TGeant3 -I/opt/software/linux-scientific7-x86_64/gcc-4.8.5/root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/include -c .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx -o .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.o In file included from .sl79_gcc485/include/StarVMCApplication.h:10:0, from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:21, from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98: /opt/software/linux-scientific7-x86_64/gcc-4.8.5/root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/include/TVirtualMC.h:804:17: error: 'virtual void TVirtualMC::ProcessEvent(Int_t)' was hidden [-Werror=overloaded-virtual] virtual void ProcessEvent(Int_t eventId); ^ In file included from .sl79_gcc485/include/TGeant3TGeo.h:12:0, from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:22, from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98: .sl79_gcc485/include/TGeant3.h:1061:16: error: by 'virtual void TGeant3::ProcessEvent()' [-Werror=overloaded-virtual] virtual void ProcessEvent(); ^ In file included from .sl79_gcc485/include/StarVMCApplication.h:10:0, from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:21, from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98: /opt/software/linux-scientific7-x86_64/gcc-4.8.5/root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/include/TVirtualMC.h:882:17: error: 'virtual void TVirtualMC::ProcessEvent(Int_t, Bool_t)' was hidden [-Werror=overloaded-virtual] virtual void ProcessEvent(Int_t eventId, Bool_t isInterruptible); ^ In file included from .sl79_gcc485/include/TGeant3TGeo.h:12:0, from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:22, from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98: .sl79_gcc485/include/TGeant3.h:1061:16: error: by 'virtual void TGeant3::ProcessEvent()' [-Werror=overloaded-virtual] virtual void ProcessEvent(); ^ ``` See https://github.com/star-bnl/star-sw/pull/619 for details --- StarVMC/geant3/TGeant3/TGeant3.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/StarVMC/geant3/TGeant3/TGeant3.h b/StarVMC/geant3/TGeant3/TGeant3.h index 1d5cd46018f..57a243b4739 100644 --- a/StarVMC/geant3/TGeant3/TGeant3.h +++ b/StarVMC/geant3/TGeant3/TGeant3.h @@ -1080,7 +1080,8 @@ class TGeant3 : public TVirtualMC { private: Int_t ConvertVolumePathString(const TString &volumeName,Int_t **lnam, Int_t **lnum); - + virtual void ProcessEvent(Int_t); + virtual void ProcessEvent(Int_t, Bool_t); protected: