Skip to content

Commit

Permalink
Do not catch polymorphic exception by value
Browse files Browse the repository at this point in the history
Fixes a gcc810 compiler warning.
  • Loading branch information
Dr15Jones committed Jun 28, 2018
1 parent a674e1f commit 6b1399a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions DataFormats/PatCandidates/src/TriggerObject.cc
Expand Up @@ -119,7 +119,7 @@ const l1extra::L1EmParticleRef TriggerObject::origL1EmRef() const
l1extra::L1EmParticleRef l1Ref;
try {
l1Ref = origObjRef().castTo< l1extra::L1EmParticleRef >();
} catch ( edm::Exception X ) {
} catch ( edm::Exception const& X ) {
if ( X.categoryCode() != edm::errors::InvalidReference ) throw X;
}
return l1Ref;
Expand All @@ -131,7 +131,7 @@ const l1extra::L1EtMissParticleRef TriggerObject::origL1EtMissRef() const
l1extra::L1EtMissParticleRef l1Ref;
try {
l1Ref = origObjRef().castTo< l1extra::L1EtMissParticleRef >();
} catch ( edm::Exception X ) {
} catch ( edm::Exception const & X ) {
if ( X.categoryCode() != edm::errors::InvalidReference ) throw X;
}
return l1Ref;
Expand All @@ -143,7 +143,7 @@ const l1extra::L1JetParticleRef TriggerObject::origL1JetRef() const
l1extra::L1JetParticleRef l1Ref;
try {
l1Ref = origObjRef().castTo< l1extra::L1JetParticleRef >();
} catch ( edm::Exception X ) {
} catch ( edm::Exception const & X ) {
if ( X.categoryCode() != edm::errors::InvalidReference ) throw X;
}
return l1Ref;
Expand All @@ -155,7 +155,7 @@ const l1extra::L1MuonParticleRef TriggerObject::origL1MuonRef() const
l1extra::L1MuonParticleRef l1Ref;
try {
l1Ref = origObjRef().castTo< l1extra::L1MuonParticleRef >();
} catch ( edm::Exception X ) {
} catch ( edm::Exception const& X ) {
if ( X.categoryCode() != edm::errors::InvalidReference ) throw X;
}
return l1Ref;
Expand Down

0 comments on commit 6b1399a

Please sign in to comment.