mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-24 03:32:35 +08:00
Fix up some no-exception compile failures
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@293623 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -18,6 +18,7 @@
|
|||||||
#include "test_allocator.h"
|
#include "test_allocator.h"
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
|
#ifndef TEST_HAS_NO_EXCEPTIONS
|
||||||
template <class T>
|
template <class T>
|
||||||
struct alloc_imp {
|
struct alloc_imp {
|
||||||
bool active;
|
bool active;
|
||||||
@@ -44,7 +45,7 @@ struct poca_alloc {
|
|||||||
|
|
||||||
alloc_imp<T> *imp;
|
alloc_imp<T> *imp;
|
||||||
|
|
||||||
poca_alloc(alloc_imp<T> *ximp) : imp (ximp) {}
|
poca_alloc(alloc_imp<T> *imp_) : imp (imp_) {}
|
||||||
|
|
||||||
template <class U>
|
template <class U>
|
||||||
poca_alloc(const poca_alloc<U>& other) : imp(other.imp) {}
|
poca_alloc(const poca_alloc<U>& other) : imp(other.imp) {}
|
||||||
@@ -65,6 +66,15 @@ bool operator!=(const poca_alloc<T>& lhs, const poca_alloc<U>& rhs)
|
|||||||
return lhs.imp != rhs.imp;
|
return lhs.imp != rhs.imp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <class S>
|
||||||
|
void test_assign(S &s1, const S& s2)
|
||||||
|
{
|
||||||
|
try { s1 = s2; }
|
||||||
|
catch ( std::bad_alloc &) { return; }
|
||||||
|
assert(false);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class S>
|
template <class S>
|
||||||
@@ -78,16 +88,6 @@ test(S s1, const typename S::allocator_type& a)
|
|||||||
assert(s2.get_allocator() == a);
|
assert(s2.get_allocator() == a);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef TEST_HAS_NO_EXCEPTIONS
|
|
||||||
template <class S>
|
|
||||||
void test_assign(S &s1, const S& s2)
|
|
||||||
{
|
|
||||||
try { s1 = s2; }
|
|
||||||
catch ( std::bad_alloc &) { return; }
|
|
||||||
assert(false);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user