mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-23 18:38:30 +08:00
Fix C++03 build breakage
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@267090 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -64,9 +64,7 @@ int main()
|
||||
}
|
||||
{
|
||||
typedef NonSwappable T;
|
||||
typedef std::array<T, 42> C1;
|
||||
typedef std::array<T, 0> C0;
|
||||
static_assert(!can_swap<C1&>::value, "");
|
||||
static_assert(can_swap<C0&>::value, "");
|
||||
C0 l = {};
|
||||
C0 r = {};
|
||||
@@ -75,4 +73,13 @@ int main()
|
||||
static_assert(noexcept(swap(l, r)), "");
|
||||
#endif
|
||||
}
|
||||
#if TEST_STD_VER >= 11
|
||||
{
|
||||
// NonSwappable is still considered swappable in C++03 because there
|
||||
// is no access control SFINAE.
|
||||
typedef NonSwappable T;
|
||||
typedef std::array<T, 42> C1;
|
||||
static_assert(!can_swap<C1&>::value, "");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
Reference in New Issue
Block a user