Skip to content

Commit 43def14

Browse files
authored
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 #619 for details
1 parent 682f7dc commit 43def14

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

StarVMC/geant3/TGeant3/TGeant3.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,7 +1080,8 @@ class TGeant3 : public TVirtualMC {
10801080
private:
10811081
Int_t ConvertVolumePathString(const TString &volumeName,Int_t **lnam,
10821082
Int_t **lnum);
1083-
1083+
virtual void ProcessEvent(Int_t);
1084+
virtual void ProcessEvent(Int_t, Bool_t);
10841085

10851086

10861087
protected:

0 commit comments

Comments
 (0)