diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2017-01-31 13:12:32 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2017-01-31 13:12:32 +0000 |
commit | 6f033f0c30bd0b82ace89a7ef5fb7be3fc52c0b3 (patch) | |
tree | ba1a99649ce4c9dac58fd8c3b73248e704aab3d1 /libcxx/test/std/strings/basic.string/string.cons/copy_alloc.pass.cpp | |
parent | 24de6fbfdb72a1c06492a922f68b03ed3035c63b (diff) | |
download | bcm5719-llvm-6f033f0c30bd0b82ace89a7ef5fb7be3fc52c0b3.tar.gz bcm5719-llvm-6f033f0c30bd0b82ace89a7ef5fb7be3fc52c0b3.zip |
Fix up some no-exception compile failures
llvm-svn: 293623
Diffstat (limited to 'libcxx/test/std/strings/basic.string/string.cons/copy_alloc.pass.cpp')
-rw-r--r-- | libcxx/test/std/strings/basic.string/string.cons/copy_alloc.pass.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libcxx/test/std/strings/basic.string/string.cons/copy_alloc.pass.cpp b/libcxx/test/std/strings/basic.string/string.cons/copy_alloc.pass.cpp index 2bfb931e5b6..cfe38661d8f 100644 --- a/libcxx/test/std/strings/basic.string/string.cons/copy_alloc.pass.cpp +++ b/libcxx/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 <class T> struct alloc_imp { bool active; @@ -44,7 +45,7 @@ struct poca_alloc { alloc_imp<T> *imp; - poca_alloc(alloc_imp<T> *ximp) : imp (ximp) {} + poca_alloc(alloc_imp<T> *imp_) : imp (imp_) {} template <class U> 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; } +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> @@ -78,16 +88,6 @@ test(S s1, const typename S::allocator_type& 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() { { |