Skip to content

Commit

Permalink
* catch an exception by references, otherwise g++ issues warning
Browse files Browse the repository at this point in the history
  in version 9 [rtj]
  • Loading branch information
rjones30 committed Sep 9, 2021
1 parent da0f2e2 commit e66fb38
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/AdaptiveSampler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ int AdaptiveSampler::mergeState(const std::string filename)
fMaximum_cells = keyval.at("fMaximum_cells");
fEfficiency_target = keyval.at("fEfficiency_target");
}
catch (std::exception e) {
catch (std::exception &e) {
std::cerr << "AdaptiveSampler::mergeState warning - "
<< "required keyword missing in " << filename
<< std::endl;
Expand Down
2 changes: 1 addition & 1 deletion src/GlueXSteppingAction.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ void GlueXSteppingAction::UserSteppingAction(const G4Step* step)
try {
proftree = bgprofiles.at(det);
}
catch(std::out_of_range err) {
catch(std::out_of_range &err) {
std::stringstream names;
names << "det" << det;
std::stringstream titles;
Expand Down

0 comments on commit e66fb38

Please sign in to comment.