http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52924
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-04-10 12:55:40 UTC --- another testcase showing a similar bug: #include <memory> template<typename T> struct Alloc : std::allocator<T> { template<typename U> struct rebind { typedef Alloc<U> other; }; template<typename U> Alloc(const Alloc<U>&) { } Alloc() = default; ~Alloc() noexcept(false) { } }; Alloc<A> alloc; auto x = std::allocate_shared<A>(alloc);