Today I was debugging a failed clang build. This construction has essentially broken down because it is_default_constructibleis rated as false. I reduced the problem to a minimal case after several hours of debasing the problem:
#include <type_traits>
#include <string>
namespace A {
struct empty_t {};
template<class T>
struct o
{
public:
template<class... U,
typename std::enable_if<
std::is_constructible<T, U...>::value,
bool
>::type = false
>
o(empty_t, U&&... u) { }
};
}
struct B
{
struct Foo
{
bool x = true;
};
std::string c;
A::o<Foo> r;
static const bool b;
};
static_assert(
std::is_default_constructible<B::Foo>::value,
"not constructible!");
The above example compiles with g ++ 6.3 and 7.0. It fails with clang ++ 4.0.0 and 3.9.1 - the static statement fails only in this very specific construction, but it still broke our assembly. As you can try for yourself, some minimal changes fix the problem (for example, by commenting on one of the specified lines). The result looks somewhat arbitrary.
, , , clang undefined. ?
, : - - , , Foo ?
, - () ++ , .