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 // REQUIRES-ANY: c++98, c++03
14 // template <class T1, class T2> struct pair
16 // pair& operator=(pair const& p);
22 struct NonAssignable {
25 NonAssignable& operator=(NonAssignable const&);
29 extern Incomplete inc_obj;
34 // Test that we don't constrain the assignment operator in C++03 mode.
35 // Since we don't have access control SFINAE having pair evaluate SFINAE
36 // may cause a hard error.
37 typedef std::pair<int, NonAssignable> P;
38 static_assert(std::is_copy_assignable<P>::value, "");
41 typedef std::pair<int, Incomplete&> P;
42 static_assert(std::is_copy_assignable<P>::value, "");
44 assert(&p.second == &inc_obj);