summaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/ext/malloc_allocator.h
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3/include/ext/malloc_allocator.h')
-rw-r--r--libstdc++-v3/include/ext/malloc_allocator.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/libstdc++-v3/include/ext/malloc_allocator.h b/libstdc++-v3/include/ext/malloc_allocator.h
index 1ae53b11ddb..5f91fe08af4 100644
--- a/libstdc++-v3/include/ext/malloc_allocator.h
+++ b/libstdc++-v3/include/ext/malloc_allocator.h
@@ -151,11 +151,15 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
template<typename _Up, typename... _Args>
void
construct(_Up* __p, _Args&&... __args)
+ noexcept(noexcept(::new((void *)__p)
+ _Up(std::forward<_Args>(__args)...)))
{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
template<typename _Up>
void
- destroy(_Up* __p) { __p->~_Up(); }
+ destroy(_Up* __p)
+ noexcept(noexcept(__p->~_Up()))
+ { __p->~_Up(); }
#else
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 402. wrong new expression in [some_] allocator::construct