From 210288f02e41390210aa7f6be9ef085c08a456c7 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Tue, 22 Mar 2011 23:45:59 +0000 Subject: [PATCH] Merge [69251] to release. Fixes #4127. [SVN r70439] --- include/boost/smart_ptr/make_shared.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/boost/smart_ptr/make_shared.hpp b/include/boost/smart_ptr/make_shared.hpp index 3d40aa2..7b605e2 100644 --- a/include/boost/smart_ptr/make_shared.hpp +++ b/include/boost/smart_ptr/make_shared.hpp @@ -49,7 +49,18 @@ private: { if( initialized_ ) { +#if defined( __GNUC__ ) + + // fixes incorrect aliasing warning + T * p = reinterpret_cast< T* >( storage_.data_ ); + p->~T(); + +#else + reinterpret_cast< T* >( storage_.data_ )->~T(); + +#endif + initialized_ = false; } }