Skip to content

PileUpMT: Address dangling temp warning

Adam Edward Barton requested to merge abarton/athena:fixtemp into main

gcc13 claims this is a dangling pointer. I merge to one statement which should superficially fix the problem. But maybe @ssnyder can review the template code to check it makes sense.

/build/atnight/localbuilds/nightlies/Athena/main--LCG104/athena/Control/PileUpMT/src/SkipEventIdxSvc.cxx: In member function 'virtual StatusCode SkipEventIdxSvc::initialize()':
/build/atnight/localbuilds/nightlies/Athena/main--LCG104/athena/Control/PileUpMT/src/SkipEventIdxSvc.cxx:88:19: warning: possibly dangling reference to a temporary [-Wdangling-reference]
   88 |       const auto& mod_prop =
      |                   ^~~~~~~
/build/atnight/localbuilds/nightlies/Athena/main--LCG104/athena/Control/PileUpMT/src/SkipEventIdxSvc.cxx:89:47: note: the temporary was destroyed at the end of the full expression '{anonymous}::getProp<std::vector<long unsigned int>&, IEvtIdModifierSvc>(modSvc, std::__cxx11::basic_string<char>(((const char*)"Modifiers"), std::allocator<char>()))'
   89 |           getProp<std::vector<std::uint64_t>&>(modSvc, "Modifiers");
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~

Merge request reports