https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64385
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
As a workaround you can simply instantiate the trait before it is used in the
function template.
Here's a reduced version of the test, which breaks when A is defined, but is
fixed by defining B:
#include <type_traits>
#include <ostream>
using trait = std::is_constructible<std::ostream, const std::ostream&>;
#if B
const bool dummy = trait::value;
#endif
#if A
template<bool> struct X { };
struct moveable_class
{
template <typename Source>
moveable_class(Source&& src, X<trait::value>* = 0)
{ }
};
#endif
static_assert( !trait::value, "");