[Boost-bugs] [Boost C++ Libraries] #6943: gcc 4.7 issue in combination with intrusive_ptr_add_ref and intrusive_ptr_release (boost_1_49_0/boost/intrusive_ptr.hpp - boost_1_49_0/boost/smart_ptr/intrusive_ptr.hpp )

Subject: [Boost-bugs] [Boost C++ Libraries] #6943: gcc 4.7 issue in combination with intrusive_ptr_add_ref and intrusive_ptr_release (boost_1_49_0/boost/intrusive_ptr.hpp - boost_1_49_0/boost/smart_ptr/intrusive_ptr.hpp )
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-05-25 08:23:15


#6943: gcc 4.7 issue in combination with intrusive_ptr_add_ref and
intrusive_ptr_release (boost_1_49_0/boost/intrusive_ptr.hpp -
boost_1_49_0/boost/smart_ptr/intrusive_ptr.hpp )
--------------------------------------------------+-------------------------
 Reporter: Joop Boonen <joop.boonen@…> | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: Boost 1.49.0 | Component: intrusive
  Version: Boost 1.49.0 | Severity: Regression
 Keywords: |
--------------------------------------------------+-------------------------
 The code of scummvm-tools ( http://www.scummvm.org/downloads/#tools ) has
 been build accoring to this example.
 http://www.codeproject.com/Articles/8394/Smart-Pointers-to-boost-your-
 code#intrusive_ptr%20-%20lightweight%20shared%20pointer


 <fails with>
 g++ -MMD -MF "decompiler/.deps/disassembler.d" -MQ
 "decompiler/disassembler.o" -MP -Wall -fmessage-length=0 -O2 -Wall
 -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-
 unwind-tables -g -g -ansi -W -Wno-unused-parameter -Wno-empty-body -Wno-
 long-long -Wno-multichar -Wno-unknown-pragmas -Wno-reor
 der -Wpointer-arith -Wcast-qual -Wshadow -Wnon-virtual-dtor -Wwrite-
 strings -fcheck-new -DHAVE_CONFIG_H -DPOSIX -I. -I. -c
 decompiler/disassembler.cpp -o decompiler/disassembler.o
 In file included from decompiler/instruction.h:30:0,
                  from decompiler/disassembler.h:29,
                  from decompiler/disassembler.cpp:23:
 /usr/include/boost/smart_ptr/intrusive_ptr.hpp: In instantiation of
 'boost::intrusive_ptr<T>::intrusive_ptr(const boost::intrusive_ptr<T>&)
 [with T = Value; boost::intrusive_ptr<T> = boost::intrusive_ptr<Value>]':
 decompiler/value.h:335:90: required from here
 /usr/include/boost/smart_ptr/intrusive_ptr.hpp:91:23: error:
 'intrusive_ptr_add_ref' was not declared in this scope, and no
 declarations were found by argument-dependent lookup at the point of
 instantiation [-fpermissive]
 In file included from decompiler/instruction.h:33:0,
                  from decompiler/disassembler.h:29,
                  from decompiler/disassembler.cpp:23:
 decompiler/refcounted.h:52:13: note: 'void
 boost::intrusive_ptr_add_ref(RefCounted*)' declared here, later in the
 translation unit
 In file included from decompiler/instruction.h:30:0,
                  from decompiler/disassembler.h:29,
                  from decompiler/disassembler.cpp:23:
 /usr/include/boost/smart_ptr/intrusive_ptr.hpp: In instantiation of
 'boost::intrusive_ptr<T>::~intrusive_ptr() [with T = Value]':
 decompiler/value.h:335:90: required from here
 /usr/include/boost/smart_ptr/intrusive_ptr.hpp:96:23: error:
 'intrusive_ptr_release' was not declared in this scope, and no
 declarations were found by argument-dependent lookup at the point of
 instantiation [-fpermissive]
 In file included from decompiler/instruction.h:33:0,
                  from decompiler/disassembler.h:29,
                  from decompiler/disassembler.cpp:23:
 decompiler/refcounted.h:59:13: note: 'void
 boost::intrusive_ptr_release(RefCounted*)' declared here, later in the
 translation unit
 make: *** [decompiler/disassembler.o] Error 1
 </fails with>
 https://build.opensuse.org/package/live_build_log?arch=i586&package
 =scummvm-tools&project=games&repository=openSUSE_Factory

 It was OK until gcc 4.7.
 As gcc 4.7 is much more strict the build of the code doesn't work any
 more.

 I suspect boost itself as no (active) functions
 // void intrusive_ptr_add_ref(T * p);
 // void intrusive_ptr_release(T * p);
 In boost_1_49_0/boost/smart_ptr/intrusive_ptr.hpp

 Searching the internet shows that more programs have this issue. It's not
 unique for scummvm-tools, they solved it, for the time being, with
 "-fpermissive" which IMHO isn't the correct way.
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672033
 http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=672397

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/6943>
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:09 UTC