From 579e75bf4344867e825b1c2489dc7cef8af1e86c Mon Sep 17 00:00:00 2001 From: Raphael Isemann Date: Wed, 17 May 2017 16:20:01 +0200 Subject: [PATCH] Don't forward declare CaloTower in CaloTowerFwd.h This header won't compile with just a forward declaration of CaloTower, because the Ref and RefVector types we declare will check the ValueTrait of it's containing class, which is in this case CaloTower. ValueTrait needs to have the definition of CaloTower to work, but we only have a forward declaration in this header available. This leads to undefined behavior, so we should replace this forward declaration with an actual include. People seem to anyway always include CaloTower too to avoid this cryptic error, so I don't think this will hit compilation times that much. --- DataFormats/CaloTowers/interface/CaloTowerFwd.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/DataFormats/CaloTowers/interface/CaloTowerFwd.h b/DataFormats/CaloTowers/interface/CaloTowerFwd.h index 2e3073c8a0c87..4339d0fc81775 100644 --- a/DataFormats/CaloTowers/interface/CaloTowerFwd.h +++ b/DataFormats/CaloTowers/interface/CaloTowerFwd.h @@ -1,6 +1,8 @@ #ifndef DATAFORMATS_CALOTOWERS_CALOTOWERFWD_H #define DATAFORMATS_CALOTOWERS_CALOTOWERFWD_H 1 +#include "DataFormats/CaloTowers/interface/CaloTower.h" + #include "DataFormats/Common/interface/Ptr.h" #include "DataFormats/Common/interface/SortedCollection.h" #include "DataFormats/Common/interface/Ref.h" @@ -9,7 +11,6 @@ #include "DataFormats/Common/interface/FwdRef.h" #include "DataFormats/Common/interface/FwdPtr.h" -class CaloTower; typedef edm::Ptr CaloTowerPtr; typedef edm::FwdPtr CaloTowerFwdPtr; typedef edm::SortedCollection CaloTowerCollection;