The problem seems to be that MSVC14/VS2015 is not capable of correctly resolving SFINAE expressions in combination with return values of constexpr functions as template parameters.
As a workaround you can assign the return value of your constexpr to a 'static const' member of a struct and use this member as template parameter.
#include <type_traits>
#include <iostream>
using std::enable_if_t;
using std::cout;
template <typename T>
constexpr bool condition() { return sizeof(T) > 1; }
template <typename T>
struct condition_ { static const bool value = condition<T>();};
template <typename T>
enable_if_t<condition_<T>::value> test() { cout << "true\n"; }
template <typename T>
enable_if_t<!condition_<T>::value> test() { cout << "false\n"; }
int main() {
test<int>();
test<bool>();
return 0;
}
http://rextester.com/VVNHB62598
You also mentioned in the comments that your actual problem appeared in another case than your MCVE (How can I Initialize a div_t Object?)
For this case the workaround might look like this:
#include <type_traits>
#include <cstdlib>
#include <utility>
template <typename T>
using divtype = decltype(std::div(std::declval<T>(), std::declval<T>()));
template <typename T>
struct condition
{
static const bool value = divtype<T>{ 1, 0 }.quot != 0;
};
template <typename T>
std::enable_if_t<condition<T>::value, divtype<T>> make_div(const T quot, const T rem) { return{ quot, rem }; }
template <typename T>
std::enable_if_t<!condition<T>::value, divtype<T>> make_div(const T quot, const T rem) { return{ rem, quot }; }
int main() {
make_div<int>(1, 2);
return 0;
}
http://rextester.com/ULDFM22040
According to this Visual Studio C++ Team blog entry VS2015 does not have (complete) support for Expression SFINAE yet.
[1] We’re planning to start implementing Expression SFINAE in the compiler immediately after 2015 RTM, and we’re planning to deliver it in an Update to 2015, supported for production use. (But not necessarily 2015 Update 1. It might take longer.)