From e3d2f2ee6ba5e03823ebb6054d96963e08959e29 Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Thu, 24 Feb 2011 22:05:04 +0000 Subject: [PATCH] Apply suggested fix. Refs #4127. [SVN r69251] --- 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; } }