1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // UNSUPPORTED: c++98, c++03
14 // template <class... Types> class tuple;
16 // template <class Alloc> tuple(allocator_arg_t, Alloc const&)
18 // Libc++ has to deduce the 'allocator_arg_t' parameter for this constructor
19 // as 'AllocArgT'. Previously libc++ has tried to support tags derived from
20 // 'allocator_arg_t' by using 'is_base_of<AllocArgT, allocator_arg_t>'.
21 // However this breaks whenever a 2-tuple contains a reference to an incomplete
22 // type as its first parameter. See PR27684.
27 struct IncompleteType;
28 extern IncompleteType inc1;
29 extern IncompleteType inc2;
30 IncompleteType const& cinc1 = inc1;
31 IncompleteType const& cinc2 = inc2;
34 using IT = IncompleteType;
35 { // try calling tuple(Tp const&...)
36 using Tup = std::tuple<const IT&, const IT&>;
38 assert(&std::get<0>(t) == &inc1);
39 assert(&std::get<1>(t) == &inc2);
41 { // try calling tuple(Up&&...)
42 using Tup = std::tuple<const IT&, const IT&>;
44 assert(&std::get<0>(t) == &inc1);
45 assert(&std::get<1>(t) == &inc2);
49 struct IncompleteType {};