Bug 784654

Summary: [PATCH] Fix boost-polygon build with gcc-4.7
Product: [Fedora] Fedora Reporter: Scott Tsai <scottt.tw>
Component: boostAssignee: Petr Machata <pmachata>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: alain.portal, alain.portal, aravindvijayan224185, denis.arnaud_fedora, mnewsome, pertusus, pmachata
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugzilla.redhat.com/show_bug.cgi?id=754865
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-26 08:42:25 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Attachments:
Description Flags
gtl-polygon-set.cc
none
boost-polygon-declare-gtlsort-earlier.patch none

Description Scott Tsai 2012-01-25 12:14:10 EST
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 12:15:29 EST
Created attachment 557490 [details]
boost-polygon-declare-gtlsort-earlier.patch
Comment 2 Petr Machata 2012-01-26 05:59:10 EST
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 05:55:56 EDT
A ticket has been created upstream: https://svn.boost.org/trac/boost/ticket/7154