You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
libcxx/test/utilities/utility/pairs/pairs.pair
Howard Hinnant 3f81e9eeba This fixes a very subtle ABI problem concerning the copy constructor of
pair, and a couple of pair-like implementation detail types.  The
C++98/03 and 11 standards all specify that the copy constructor of
pair<int, int> is trivial. However as libc++ tracked the draft C++11
standard over the years, this copy constructor became non-trivial, and
then just recently was corrected back to trivial for C++11.

Unfortunately (for libc++1) the Itanium ABI specifies different calling
conventions for trivial and non-trivial copy constructors.  Therefore
currently the C++03 libc++ copy constructor for pair<int, int> is ABI
incompatible with the C++11 libc++ copy constructor for pair<int, int>.
This is Bad(tm).   This patch corrects the situation by making this copy
constructor trivial in C++03 mode as well.

Just in case it is needed for an incomplete C++11 compiler, libc++
retains the ability to support pair with rvalue references, but without
defaulted special members.  However the pair needs non-trivial special
members to implement this special case, (as it did when clang was in
this place a couple of years ago).

During this work a bug was also found and fixed in
is_trivially_constructible.

And there is a minor drive-by fix in <__config> regarding
__type_visibility__.

A test is updated to ensure that the copy constructor of pair<int, int>
is trivial in both C++03 and C++11.  This test will necessarily fail for
a compiler that implements rvalue references but not defaulted special
members.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@194536 91177308-0d34-0410-b5e6-96231b3b80d8
12 years ago
..
U_V.pass.cpp license change 15 years ago
assign_const_pair_U_V.pass.cpp license change 15 years ago
assign_rv_pair.pass.cpp license change 15 years ago
assign_rv_pair_U_V.pass.cpp license change 15 years ago
const_first_const_second.pass.cpp Bug 16599 part 2: Make std::pair's constructors and comparison operators (and make_pair) constexpr. 12 years ago
const_pair_U_V.pass.cpp Bug 16599 part 2: Make std::pair's constructors and comparison operators (and make_pair) constexpr. 12 years ago
copy_ctor.pass.cpp This fixes a very subtle ABI problem concerning the copy constructor of 12 years ago
default.pass.cpp War on tabs 12 years ago
piecewise.pass.cpp license change 15 years ago
rv_pair_U_V.pass.cpp license change 15 years ago
swap.pass.cpp license change 15 years ago
types.pass.cpp license change 15 years ago