Subject: [Boost-bugs] [Boost C++ Libraries] #5279: [Foreach] Compile-time const rvalue detection fails with gcc 4.6
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2011-03-08 12:20:29
#5279: [Foreach] Compile-time const rvalue detection fails with gcc 4.6
-------------------------------------+--------------------------------------
Reporter: mimomorin@⦠| Owner: eric_niebler
Type: Patches | Status: new
Milestone: To Be Determined | Component: foreach
Version: Boost Development Trunk | Severity: Problem
Keywords: |
-------------------------------------+--------------------------------------
Recently, gcc 4.6 changed the behavior of rvalue conversions (from
gcc-4.6-20110305).
You can see the related info here:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47851
This breaks compile-time const rvalue detection in Boost.Foreach;
Const rvalues are incorrectly treated as lvalues, and so a segmentation
fault occurs in the following code:
{{{
#include <list>
#include <boost/foreach.hpp>
typedef const std::list<int> clist;
int main (int argc, char* argv[])
{
BOOST_FOREACH(int x, clist(3)) {}
return 0;
}
}}}
Though gcc 4.6 is not yet released, I think this behavior is highly likely
to happen in the release version. So I reported this problem here.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/5279> 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:05 UTC