fix compile error and several warnings with gcc 8 See merge request !216 (cherry picked from commit 33b9cb42) ae1ec50a CompPair: make `operator()` a const method bad3dd33 do not catch polymorphic types by value 7fea4b07 silence warnings about unused variables