Boost logo

Boost :

Subject: Re: [boost] Any-Range containing transformed range fails when compiled with optimizations
From: Auer, Jens (jens.auer_at_[hidden])
Date: 2016-01-16 05:48:06

Hi, I had to slightly modify the code to make it work with boost 1.55. I then ran your examples through some combinations of gcc/boost using the online compiler You can choose the gcc version and the boost version the compiler will use. Here are the results: compiler boost result gcc 4.9.2 1.55 ok gcc 4.9.2 1.56 fail gcc 4.9.2 1.60 fail gcc 5.2.0 1.55 ok gcc 5.2.0 1.56 fail clang 3.7 1.60 fail clang 3.7 1.55 ok clang 3.7 1.56 fail Boost 1.55 consistenly work with gcc and clang. Starting with Boost 1.56, it consistently fails. Best wishes, Jens -- Jens Auer | CGI | Software-Engineer CGI (Germany) GmbH & Co. KG Rheinstraße 95 | 64295 Darmstadt | Germany T: +49 6151 36860 154 jens.auer_at_[hidden] Unsere Pflichtangaben gemäß § 35a GmbHG / §§ 161, 125a HGB finden Sie unter CONFIDENTIALITY NOTICE: Proprietary/Confidential information belonging to CGI Group Inc. and its affiliates may be contained in this message. If you are not a recipient indicated or intended in this message (or responsible for delivery of this message to such person), or you think for any reason that this message may have been addressed to you in error, you may not use or copy or deliver this message to anyone else. In such case, you should destroy this message and are asked to notify the sender by reply e-mail. ________________________________________ Von: Boost [boost-bounces_at_[hidden]]&quot; im Auftrag von &quot;Seth [bugs_at_[hidden]] Gesendet: Freitag, 15. Januar 2016 14:08 An: boost_at_[hidden] Betreff: Re: [boost] Any-Range containing transformed range fails when compiled with optimizations On 15-01-16 09:04, Auer, Jens wrote: > I've made some more investigations. I modified the program slightly to be able to compile it with older gcc and boost versions to see when it broke. Our project uses gcc 4.9.2 with boost 1.55, but when one of my colleagues compiled it on his local machine with gcc 5.2 and boost 1.59 we started to see the issues. I made a version of the code that's c++03 safe and still exhibits the problem on all clang/gcc versions I own. Sadly I can't download boost 1.55 ( is down) and modular boost doesn't seem to be able to build (headers) in the 1.55 tag... So maybe you can try this for a spin: #include <vector> #include <boost/range.hpp> #include <boost/range/any_range.hpp> #include <boost/range/adaptor/transformed.hpp> #include <iostream> static bool ok = true; struct SourceEvent { unsigned event; void* ptr; }; template <typename R> void test(R const& r) { ok &= (100u == boost::size(r)); for (typename boost::range_iterator<R>::type it = boost::begin(r); it != boost::end(r); ++it) { ok &= (0u == it->event); ok &= (0 == it->ptr); } } struct Xfrm { typedef SourceEvent result_type; SourceEvent operator()(unsigned) const { SourceEvent se = {}; return se; } } xfrm_; SourceEvent xfrm(unsigned) { SourceEvent se = {}; return se; } int main() { using boost::adaptors::transformed; typedef boost::any_range<SourceEvent, boost::forward_traversal_tag/*, SourceEvent, std::ptrdiff_t*/> R; std::vector<int> v(100, 0); test (v | transformed(xfrm_)); test<R>(v | transformed(xfrm_)); if (ok) std::cout << "OK" << std::endl; else std::cout << "FAIL" << std::endl; return ok?0:1; } _______________________________________________ Unsubscribe & other changes:

Boost list run by bdawes at, gregod at, cpdaniel at, john at