// Member detector base
-template <template <class...> class _Templ, class ..._Args>
-true_type __sfinae_test_impl(_FirstType<int, _Templ<_Args...> >);
+template <template <class...> class _Templ, class ..._Args, class = _Templ<_Args...>>
+true_type __sfinae_test_impl(int);
template <template <class...> class, class ...>
false_type __sfinae_test_impl(...);
test_is_constructible<const int&, ExplicitTo<int&>&>();
test_is_constructible<const int&, ExplicitTo<int&>>();
- test_is_constructible<int&, ExplicitTo<int&>>();
- test_is_constructible<const int&, ExplicitTo<int&&>>();
+
// Binding through reference-compatible type is required to perform
// direct-initialization as described in [over.match.ref] p. 1 b. 1:
+ //
+ // But the rvalue to lvalue reference binding isn't allowed according to
+ // [over.match.ref] despite Clang accepting it.
test_is_constructible<int&, ExplicitTo<int&>>();
+#ifndef TEST_COMPILER_GCC
test_is_constructible<const int&, ExplicitTo<int&&>>();
+#endif
static_assert(std::is_constructible<int&&, ExplicitTo<int&&>>::value, "");
#ifdef __clang__