What are the rules by which std::is_constructible handles private constructors? Given the following code:
#include <iostream>
class Class {
private:
Class() { }
};
template <typename T>
class Test {
public:
static void test() {
std::cout
//<< std::is_constructible<Class>::value
<< std::is_constructible<T>::value
<< std::endl;
}
};
int main() {
Test<Class>::test();
}
This prints 0 (ideone), i.e., T is not default constructible.
Uncommenting the commented line, it prints 11 (ideone), so T suddently became default constructible.
I could find reasoning to support both results, but I don't understand how including the commented line changes the result of the second. Is this somehow invoking UB? Is this a compiler bug? Or is std::is_constructible really that inconsistent?