Skip to content

disambiguate overloads for empty index list

Erik Schultheis requested to merge ngc92/eigen:clang-fix into master

Clang complains about an ambiguous overload for creating compile time indices when the index list is empty. (e.g. https://gitlab.com/libeigen/eigen/-/jobs/1856367113#L8459)

../unsupported/test/../../unsupported/Eigen/CXX11/src/Tensor/TensorMeta.h:284:12: error: call to 'customIndices2Array' is ambiguous
    return customIndices2Array(idx, typename gen_numeric_list<Index, NumIndices>::type{});

In principle, the generic version should be enough I think, but the git blame said that the second overload was introduced to prevent some warnings, so I've kept the two overloads.

Instead, the first overload now explicitly mentions at least one single entry, thus not being viable for the empty case and preventing the ambiguous call.

Merge request reports