Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r69251 - trunk/boost/smart_ptr
From: pdimov_at_[hidden]
Date: 2011-02-24 17:05:05


Author: pdimov
Date: 2011-02-24 17:05:04 EST (Thu, 24 Feb 2011)
New Revision: 69251
URL: http://svn.boost.org/trac/boost/changeset/69251

Log:
Apply suggested fix. Refs #4127.
Text files modified:
   trunk/boost/smart_ptr/make_shared.hpp | 11 +++++++++++
   1 files changed, 11 insertions(+), 0 deletions(-)

Modified: trunk/boost/smart_ptr/make_shared.hpp
==============================================================================
--- trunk/boost/smart_ptr/make_shared.hpp (original)
+++ trunk/boost/smart_ptr/make_shared.hpp 2011-02-24 17:05:04 EST (Thu, 24 Feb 2011)
@@ -49,7 +49,18 @@
     {
         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;
         }
     }


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk