diff --git a/include/boost/container/hub.hpp b/include/boost/container/hub.hpp
index 5104fc5..74d3b7a 100644
--- a/include/boost/container/hub.hpp
+++ b/include/boost/container/hub.hpp
@@ -1287,7 +1287,7 @@ public:
//!
//! Postcondition: capacity() >= n.
//!
- //! Throws: length_error_t if n > max_size(), plus any exception
+ //! Throws: if n > max_size(), plus any exception
//! thrown by the allocator.
//!
//! Complexity: Linear in the number of reserved blocks allocated.
diff --git a/test/test_hub_api.cpp b/test/test_hub_api.cpp
index 0b97e1c..68371f0 100644
--- a/test/test_hub_api.cpp
+++ b/test/test_hub_api.cpp
@@ -16,6 +16,7 @@ int main() { return 0; }
#include
#include
#include
+#include
#include
#include
#include
@@ -384,9 +385,12 @@ void test(const typename Hub::allocator_type& al = {})
BOOST_TEST_EQ(cx.capacity(), c);
test_equal(x, x2);
+#ifndef BOOST_NO_EXCEPTIONS
if(cx.max_size() < (size_type)(-1)) {
- BOOST_TEST_THROWS(x.reserve(cx.max_size() + 1), std::length_error);
+ BOOST_TEST_THROWS(
+ x.reserve(cx.max_size() + 1), boost::container::length_error_t);
}
+#endif
}
/* available list partitioned in (non-empty)|(empty) */
diff --git a/test/test_hub_exception_safety.cpp b/test/test_hub_exception_safety.cpp
index 0285697..be99148 100644
--- a/test/test_hub_exception_safety.cpp
+++ b/test/test_hub_exception_safety.cpp
@@ -6,7 +6,11 @@
#include
-#if BOOST_CXX_VERSION < 201103L
+/* This test exercises exception safety, so it is meaningless (and would not
+ * even compile, as it relies on try/catch and throw) when exceptions are
+ * disabled.
+ */
+#if BOOST_CXX_VERSION < 201103L || defined(BOOST_NO_EXCEPTIONS)
int main() { return 0; }