문제

Is the following C++1y/C++14 program ill-formed?

template<class> constexpr auto X = 42;

int main()
{
        static_assert(X<int> == 42, "");
}

Why / why not?

Clang trunk complains that:

error: invalid operands to binary expression ('auto' and 'int')
도움이 되었습니까?

해결책

This was a bug in clang, it is now fixed: http://llvm.org/bugs/show_bug.cgi?id=19152

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top