[Boost-bugs] [Boost C++ Libraries] #11517: unused.hpp does not compile with g++ (<= 4.6) and -std=gnu++0x

Subject: [Boost-bugs] [Boost C++ Libraries] #11517: unused.hpp does not compile with g++ (<= 4.6) and -std=gnu++0x
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-07-30 15:32:23


#11517: unused.hpp does not compile with g++ (<= 4.6) and -std=gnu++0x
-------------------------------------------+---------------------
 Reporter: Ben Goodrich <goodrich.ben@…> | Owner: djowel
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: fusion
  Version: Boost 1.58.0 | Severity: Problem
 Keywords: |
-------------------------------------------+---------------------
 To reproduce, try to execute
 {{{
 g++-4.6 -std=gnu++0x -I. -o /tmp/unused.gch
 boost/fusion/support/unused.hpp
 }}}
 I obtain
 {{{
 boost/fusion/support/unused.hpp: In member function ‘const
 boost::fusion::unused_type& boost::fusion::unused_type::operator=(const
 boost::fusion::unused_type&) const’:
 boost/fusion/support/unused.hpp:57:9: error: ‘this’ is not a potential
 constant expression
 boost/fusion/support/unused.hpp: At global scope:
 boost/fusion/support/unused.hpp:67:39: error: both ‘const’ and ‘constexpr’
 cannot be used here
 }}}

 Such code later became acceptable to g++ but they did not backport the fix
 beyond 4.7.x ( [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54086] ). I
 am able to work around this problem by adding some lines like
 {{{
 #if defined(__GXX_EXPERIMENTAL_CXX0X__) && __GNUC__ == 4 &&
 __GNUC_MINOR__ <= 6
 }}}
 in the attached file but you probably want a better fix.

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