[Boost-bugs] [Boost C++ Libraries] #1773: VC8 compiler bug makes boost spill types into global namespace, which breaks IntelTBB

Subject: [Boost-bugs] [Boost C++ Libraries] #1773: VC8 compiler bug makes boost spill types into global namespace, which breaks IntelTBB
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-04-04 13:42:57


#1773: VC8 compiler bug makes boost spill types into global namespace, which
breaks IntelTBB
------------------------------+---------------------------------------------
 Reporter: macke_at_[hidden] | Owner: ramey
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: serialization
  Version: Boost 1.35.0 | Severity: Regression
 Keywords: |
------------------------------+---------------------------------------------
 Hi all,

 This is with VC8 SP1.

 We tried to compile our app with boost 1.35.0 and got errors in Intel
 TBB that int32_t was already defined.

 After some debugging, we have boiled it down to the following repro
 case, which shouldn't compile. It compiles on VC8 but not on VC9.

 Just run cl on the following:

 {{{
 #!cpp
 namespace bzt {
    typedef long fiddle;
 }

 namespace foo {

 using namespace bzt; // removing using makes it work too

 class baz
 {
 public:
      virtual void meep() // removeingvirtual makes it fail
      { }
 };

 namespace foobar {

    void geronimo() {
        throw baz();
    }

 } // namespace foobar

 } // namespace foo

 fiddle dummy; // should not compile, but does
 }}}

 For boost, the actual names used are

 namespace bzt = boost
 fiddle = int32_t
 foo = boost_132
 baz = bad_weak_ptr
 meep = bad_weak_ptr::what
 foobar = detail
 geronimo = bad_weak_ref
 throw baz() = boost::throw_exception(bad_weak_ptr)

 and can be reproduced using boost code with simply:

 {{{
 !#cpp
 #include <boost/cstdint.hpp>
 #include <boost/detail/workaround.hpp>
 #include <boost/serialization/detail/shared_count_132.hpp>

 int32_t dummy; // Should not compile, but does.
 }}}

 The function throwing is
 boost_132::detail::sp_counted_base::add_ref_lock() which does
 boost::throw:

 {{{
 !#cpp
 void add_ref_lock()
 {
    if(use_count_ == 0) boost::throw_exception(bad_weak_ptr());
    ++use_count_;
 }
 }}}

 Where bad_weak_ptr have a virtual function.

 I suppose a fix/workaround would be to not use the boost_132 namespace
 which imports boost.

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1773>
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:49:57 UTC