[Boost-bugs] [Boost C++ Libraries] #8152: operator_bool write access violation error in MSVC builds

Subject: [Boost-bugs] [Boost C++ Libraries] #8152: operator_bool write access violation error in MSVC builds
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-23 01:24:36


#8152: operator_bool write access violation error in MSVC builds
-----------------------------------+----------------------------------------
 Reporter: rossmpublic@… | Owner: pdimov
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: smart_ptr
  Version: Boost 1.53.0 | Severity: Problem
 Keywords: |
-----------------------------------+----------------------------------------
 Using the unspecified_bool_type operator and the following pragma is
 causing write access violations with the Microsoft compiler:

 #pragma pointers_to_members(full_generality, virtual_inheritance)

 This behavior has been confirmed for boost_1_44_0 using an msvc90 build
 and for boost_1_53_0 using a msvc10 build.

 Here is the code that reproduces the error:

 {{{
 //------- main.cpp ---------

 #pragma pointers_to_members(full_generality, virtual_inheritance)

 #include "TestClass.h"

 int main(int argc, char* argv[])
 {
   IntPointer p(new int);
   bool isValid = p;

   TestClass test;
   test.setInt(p);

   return 0;
 }

 //------ TestClass.h ----------

 #pragma once

 #include <boost/shared_ptr.hpp>

 typedef boost::shared_ptr<int> IntPointer;

 class TestClass
 {
 public:
   void setInt(IntPointer p);
 private:
   IntPointer m_p;
 };


 //----- TestClass.cpp

 #include "TestClass.h"

 void TestClass::setInt(IntPointer p)
 {
   m_p = p;
   bool isValid = p;
 }

 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/8152>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC