Functor compilation error on clang12
There is a recurrent test failure in DaVinci only on x86_64_v2-centos7-clang12-opt https://lhcb-nightlies.web.cern.ch/nightly/lhcb-master/1906/DaVinci/x86_64_v2-centos7-clang12-opt/tests#DaVinciExamples_tupling_test_davinci_tupling_All
In file included from <built-in>:1:
In file included from /workspace/build/Rec/Phys/FunctorCore/include/Functors/JIT_includes.h:32:
[NON-XML-CHAR-0x1B][1m/workspace/build/Rec/Phys/FunctorCore/include/Functors/Functional.h:223:39: [NON-XML-CHAR-0x1B][0m[NON-XML-CHAR-0x1B][0;1;31merror: [NON-XML-CHAR-0x1B][0m[NON-XML-CHAR-0x1B][1mnon-constant-expression cannot be narrowed from type 'std::integral_constant<int, -1>::value_type' (aka 'int') to 'typename Optional<bool>::value_type' (aka 'bool') in initializer list [-Wc++11-narrowing][NON-XML-CHAR-0x1B][0m
return typename U::value_type{m_value};
[NON-XML-CHAR-0x1B][0;1;32m ^~~~~~~
[NON-XML-CHAR-0x1B][0m[NON-XML-CHAR-0x1B][1m/cvmfs/lhcb.cern.ch/lib/lcg/releases/gcc/10.3.0-f5826/x86_64-centos7/lib/gcc/x86_64-pc-linux-gnu/10.3.0/../../../../include/c++/10.3.0/type_traits:2506:7: [NON-XML-CHAR-0x1B][0m[NON-XML-CHAR-0x1B][0;1;30mnote: [NON-XML-CHAR-0x1B][0min instantiation of function template specialization 'Functors::Functional::ValueOr<std::integral_constant<int, -1>>::operator()<Functors::Optional<bool>>' requested here[NON-XML-CHAR-0x1B][0m
std::declval<_Fn>()(std::declval<_Args>()...)
...
It links to this line https://gitlab.cern.ch/lhcb/Rec/-/blob/master/Phys/FunctorCore/include/Functors/Functional.h#L223
@graven @sponce @rmatev @clemenci any idea what that could be?