diff --git a/test/std/strings/basic.string/string.cons/copy_alloc.pass.cpp b/test/std/strings/basic.string/string.cons/copy_alloc.pass.cpp index 2bfb931e5..cfe38661d 100644 --- a/test/std/strings/basic.string/string.cons/copy_alloc.pass.cpp +++ b/test/std/strings/basic.string/string.cons/copy_alloc.pass.cpp @@ -18,6 +18,7 @@ #include "test_allocator.h" #include "min_allocator.h" +#ifndef TEST_HAS_NO_EXCEPTIONS template struct alloc_imp { bool active; @@ -44,7 +45,7 @@ struct poca_alloc { alloc_imp *imp; - poca_alloc(alloc_imp *ximp) : imp (ximp) {} + poca_alloc(alloc_imp *imp_) : imp (imp_) {} template poca_alloc(const poca_alloc& other) : imp(other.imp) {} @@ -65,6 +66,15 @@ bool operator!=(const poca_alloc& lhs, const poca_alloc& rhs) return lhs.imp != rhs.imp; } +template +void test_assign(S &s1, const S& s2) +{ + try { s1 = s2; } + catch ( std::bad_alloc &) { return; } + assert(false); +} +#endif + template @@ -78,16 +88,6 @@ test(S s1, const typename S::allocator_type& a) assert(s2.get_allocator() == a); } -#ifndef TEST_HAS_NO_EXCEPTIONS -template -void test_assign(S &s1, const S& s2) -{ - try { s1 = s2; } - catch ( std::bad_alloc &) { return; } - assert(false); -} -#endif - int main() { {