Skip to content

Commit

Permalink
Don't forward declare CaloTower in CaloTowerFwd.h
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Teemperor committed Jun 6, 2017
1 parent 67871c1 commit 579e75b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion DataFormats/CaloTowers/interface/CaloTowerFwd.h
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -9,7 +11,6 @@
#include "DataFormats/Common/interface/FwdRef.h"
#include "DataFormats/Common/interface/FwdPtr.h"

class CaloTower;
typedef edm::Ptr<CaloTower> CaloTowerPtr;
typedef edm::FwdPtr<CaloTower> CaloTowerFwdPtr;
typedef edm::SortedCollection<CaloTower> CaloTowerCollection;
Expand Down

0 comments on commit 579e75b

Please sign in to comment.