g++-5 and g++-6 are unable to compile mapbox::geometry::geometry_collection. The testcase in this PR isolates the bug that @flippmoke discovered during mapnik-vector-tile development:
In file included from include/mapbox/geometry/geometry.hpp:10:0,
from include/mapbox/geometry.hpp:9,
from tests/unit/collection.cpp:1:
/home/travis/build/mapbox/geometry.hpp/mason_packages/headers/variant/1.1.4/include/mapbox/variant.hpp: In instantiation of ‘const size_t mapbox::util::variant<mapbox::geometry::point<double>, mapbox::geometry::line_string<double, std::vector>, mapbox::geometry::polygon<double, std::vector>, mapbox::geometry::multi_point<double, std::vector>, mapbox::geometry::multi_line_string<double, std::vector>, mapbox::geometry::multi_polygon<double, std::vector>, mapbox::geometry::geometry_collection<double, std::vector> >::data_size’:
/home/travis/build/mapbox/geometry.hpp/mason_packages/headers/variant/1.1.4/include/mapbox/variant.hpp:566:81: required from ‘class mapbox::util::variant<mapbox::geometry::point<double>, mapbox::geometry::line_string<double, std::vector>, mapbox::geometry::polygon<double, std::vector>, mapbox::geometry::multi_point<double, std::vector>, mapbox::geometry::multi_line_string<double, std::vector>, mapbox::geometry::multi_polygon<double, std::vector>, mapbox::geometry::geometry_collection<double, std::vector> >’
include/mapbox/geometry/geometry.hpp:31:8: required from ‘struct mapbox::geometry::geometry<double>’
include/mapbox/geometry/geometry.hpp:49:27: required from ‘struct mapbox::geometry::geometry_collection<double>’
tests/unit/collection.cpp:4:51: required from here
/home/travis/build/mapbox/geometry.hpp/mason_packages/headers/variant/1.1.4/include/mapbox/variant.hpp:559:67: error: invalid application of ‘sizeof’ to incomplete type ‘mapbox::geometry::geometry_collection<double>’
static const std::size_t data_size = detail::static_max<sizeof(Types)...>::value;
1) Adding template instantiation of geometry<same_type> before geometry_collection<same_type>. This happens in the tests/test.cpp otherwise the compile error would hit those as well.
g++-5 and g++-6 are unable to compile
mapbox::geometry::geometry_collection
. The testcase in this PR isolates the bug that @flippmoke discovered during mapnik-vector-tile development:Full error: https://travis-ci.org/mapbox/geometry.hpp/jobs/191737918#L290
This regressed in https://github.com/mapbox/geometry.hpp/commit/f00a7aebf1358421061140fcb6adf15e500619d7.
It can be worked around by:
1) Adding template instantiation of
geometry<same_type>
beforegeometry_collection<same_type>
. This happens in thetests/test.cpp
otherwise the compile error would hit those as well.2) Adding back the use of recursive_wrapper
/cc @artemp for help on next steps.