I have a code example which originates from llvm source code but modified to clearly provide the issue.
It compiles fine with clang but fails with icl. Here's the code:
#include <type_traits>
template <typename E, typename Enable = void>
struct is_valid : std::false_type {};
template <typename E>
struct is_valid<E, typename std::enable_if<sizeof(E::EnumMember) >= 0>::type> : std::true_type {};
template <typename E, typename = typename std::enable_if<is_valid<E>::value>::type>
void function(const E &myEnum) {
return;
}
enum MyEnum {
EnumMember = 0
};
int main() {
MyEnum myEnum;
function(myEnum);
}
Intel Compiler XE 2018, Windows