Fix compilation issues under gcc11
amete opened this issue · comments
Alaettin Serhan Mete commented
As reported by Johannes, we seem to have issues building in gcc11
:
/build/atnight/localbuilds/nightlies/master--dev4LCG/build/build/AthenaExternals/src/prmon/package/src/registry.h: In instantiation of 'static std::vector<std::__cxx11::basic_string<char> > registry::Registry<T, Pack>::list_registered() [with T = Imonitor; Pack = {}]':
/build/atnight/localbuilds/nightlies/master--dev4LCG/build/build/AthenaExternals/src/prmon/package/src/prmon.cpp:42:60: required from here
/build/atnight/localbuilds/nightlies/master--dev4LCG/build/build/AthenaExternals/src/prmon/package/src/registry.h:68:21: error: loop variable 'k' creates a copy from type 'const std::pair<const std::__cxx11::basic_string<char>, std::function<Imonitor*()> >' [-Werror=range-loop-construct]
68 | for (const auto k : ctors()) {
| ^
/build/atnight/localbuilds/nightlies/master--dev4LCG/build/build/AthenaExternals/src/prmon/package/src/registry.h:68:21: note: use reference type to prevent copying
68 | for (const auto k : ctors()) {
| ^
| &
We should go ahead and make sure we can compile w/ gcc11
(it would be nice to extend the CI coverage too).
Graeme A Stewart commented
Closed with #192