Bug 784654 - [PATCH] Fix boost-polygon build with gcc-4.7
Summary: [PATCH] Fix boost-polygon build with gcc-4.7
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: boost
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Machata
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-01-25 17:14 UTC by Scott Tsai
Modified: 2015-05-05 01:36 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-01-26 13:42:25 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
gtl-polygon-set.cc (1.73 KB, text/x-c++src)
2012-01-25 17:14 UTC, Scott Tsai
no flags Details
boost-polygon-declare-gtlsort-earlier.patch (369 bytes, patch)
2012-01-25 17:15 UTC, Scott Tsai
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 754865 0 medium CLOSED Update of Boost to 1.48 2021-02-22 00:41:40 UTC

Internal Links: 754865

Description Scott Tsai 2012-01-25 17:14:10 UTC
Created attachment 557489 [details]
gtl-polygon-set.cc

Description of problem:

Building the attached gtl-polygon-set.cc (example program from upstream website: http://www.boost.org/doc/libs/1_48_0/libs/polygon/doc/gtl_polygon_set_usage.htm)
with boost-devel-1.48.0-8.fc17.x86_64 and gcc-c++-4.7.0-0.9.fc17.x86_64 fails with:
g++ -Wall -O2 -g    gtl-polygon-set.cc   -o gtl-polygon-set
In file included from /usr/include/boost/polygon/polygon.hpp:64:0,
                 from gtl-polygon-set.cc:8:
/usr/include/boost/polygon/polygon_90_set_data.hpp: In instantiation of ‘void boost::polygon::polygon_90_set_data<T>::sort() const [with T = int]’:
/usr/include/boost/polygon/polygon_45_set_data.hpp:1550:7:   required from ‘void boost::polygon::polygon_45_set_data<Unit>::applyAdaptiveBoolean_(boost::polygon::polygon_45_set_data<Unit>&, const boost::polygon::polygon_45_set_data<Unit>&) const [with int op = 0; Unit = int]’
/usr/include/boost/polygon/detail/polygon_set_view.hpp:108:9:   required from ‘void boost::polygon::execute_boolean_op(value_type&, const geometry_type_1&, const geometry_type_2&) [with value_type = boost::polygon::polygon_set_data<int>; geometry_type_1 = std::vector<boost::polygon::polygon_data<int> >; geometry_type_2 = boost::polygon::rectangle_data<int>; int op_type = 0]’
/usr/include/boost/polygon/detail/polygon_set_view.hpp:197:5:   required from ‘geometry_type_1& boost::polygon::self_assignment_boolean_op(geometry_type_1&, const geometry_type_2&) [with geometry_type_1 = std::vector<boost::polygon::polygon_data<int> >; geometry_type_2 = boost::polygon::rectangle_data<int>; int op_type = 0]’
/usr/include/boost/polygon/polygon_set_concept.hpp:388:90:   required from ‘typename boost::enable_if<typename boost::polygon::gtl_and_4<boost::polygon::operators::yes_ps_ope, boost::polygon::gtl_yes, typename boost::polygon::is_mutable_polygon_set_type<polygon_set_type_1>::type, typename boost::polygon::is_any_polygon_set_type<polygon_set_type_2>::type>::type, geometry_type_1>::type& boost::polygon::operators::operator+=(geometry_type_1&, const geometry_type_2&) [with geometry_type_1 = std::vector<boost::polygon::polygon_data<int> >; geometry_type_2 = boost::polygon::rectangle_data<int>; typename boost::enable_if<typename boost::polygon::gtl_and_4<boost::polygon::operators::yes_ps_ope, boost::polygon::gtl_yes, typename boost::polygon::is_mutable_polygon_set_type<polygon_set_type_1>::type, typename boost::polygon::is_any_polygon_set_type<polygon_set_type_2>::type>::type, geometry_type_1>::type = std::vector<boost::polygon::polygon_data<int> >]’
gtl-polygon-set.cc:20:43:   required from here
/usr/include/boost/polygon/polygon_90_set_data.hpp:299:9: error: ‘gtlsort’ 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 /usr/include/boost/polygon/detail/scan_arbitrary.hpp:13:0,
                 from /usr/include/boost/polygon/polygon_set_data.hpp:929,
                 from /usr/include/boost/polygon/polygon.hpp:82,
                 from gtl-polygon-set.cc:8:
/usr/include/boost/polygon/detail/polygon_sort_adaptor.hpp:58:10: note: ‘template<class iter_type, class pred_type> void boost::polygon::gtlsort(iter_type, iter_type, const pred_type&)’ declared here, later in the translation unit
make: *** [gtl-polygon-set] Error 1


This can be fixed by patching boost/polygon.hpp to make the gtlsort() declaration appear earlier:
--- /usr/include/boost/polygon/polygon.hpp.orig	2012-01-26 01:05:15.934998805 +0800
+++ /usr/include/boost/polygon/polygon.hpp	2012-01-26 01:13:10.547000000 +0800
@@ -24,6 +24,8 @@
 #include "transform.hpp"
 #include "detail/transform_detail.hpp"
 
+#include "detail/polygon_sort_adaptor.hpp"
+
 //interval
 #include "interval_data.hpp"
 #include "interval_traits.hpp"

Version-Release number of selected component (if applicable):
boost-devel-1.48.0-8.fc17.x86_64
gcc-c++-4.7.0-0.9.fc17.x86_64

Comment 1 Scott Tsai 2012-01-25 17:15:29 UTC
Created attachment 557490 [details]
boost-polygon-declare-gtlsort-earlier.patch

Comment 2 Petr Machata 2012-01-26 10:59:10 UTC
Thanks for the patch.  I'll add it to git soon, and spin a build together with ARM patches (which shouldn't impact mainline fedora).

Comment 3 Denis Arnaud 2012-07-20 09:55:56 UTC
A ticket has been created upstream: https://svn.boost.org/trac/boost/ticket/7154


Note You need to log in before you can comment on or make changes to this bug.