Fix various test failures with GCC

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@371880 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/type_traits b/include/type_traits
index 03e8bba..7dc5de7 100644
--- a/include/type_traits
+++ b/include/type_traits
@@ -509,8 +509,8 @@
 
 // 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(...);
 
diff --git a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
index a5b723c..b519724 100644
--- a/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
+++ b/test/std/utilities/meta/meta.unary/meta.unary.prop/is_constructible.pass.cpp
@@ -244,13 +244,17 @@
 
     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__
diff --git a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/deduct.pass.cpp b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/deduct.pass.cpp
index 4944f64..b14447a 100644
--- a/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/deduct.pass.cpp
+++ b/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/deduct.pass.cpp
@@ -13,7 +13,7 @@
 // GCC's implementation of class template deduction is still immature and runs
 // into issues with libc++. However GCC accepts this code when compiling
 // against libstdc++.
-// XFAIL: gcc
+// XFAIL: gcc-5, gcc-6, gcc-7
 
 // <tuple>