Fix PR27684 - std::tuple no longer accepts reference to incomplete type in some cases.
Libc++ has to deduce the 'allocator_arg_t' parameter as 'AllocArgT' for the
following constructor:
template <class Alloc> tuple(allocator_arg_t, Alloc const&)
Previously libc++ has tried to support tags derived from 'allocator_arg_t' by
using 'is_base_of<AllocArgT, allocator_arg_t>'. However this breaks whenever a
2-tuple contains a reference to an incomplete type as its first parameter.
See https://llvm.org/bugs/show_bug.cgi?id=27684
llvm-svn: 273334
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 092386771dbebffbf1d2752cdaee4be577239e9b
diff --git a/include/tuple b/include/tuple
index 73f42a0..c7df34a 100644
--- a/include/tuple
+++ b/include/tuple
@@ -662,7 +662,7 @@
template <class _AllocArgT, class _Alloc, bool _Dummy = true, class = typename enable_if<
__lazy_and<
- is_base_of<allocator_arg_t, _AllocArgT>,
+ is_same<allocator_arg_t, _AllocArgT>,
__lazy_all<__dependent_type<is_default_constructible<_Tp>, _Dummy>...>
>::value
>::type>