#13386 closed Bugs (fixed)
buffered_piece_collection.hpp: parse error in template argument list
Reported by: | kayarre | Owned by: | Barend Gehrels |
---|---|---|---|
Milestone: | Boost 1.67.0 | Component: | geometry |
Version: | Boost 1.66.0 | Severity: | Regression |
Keywords: | Cc: |
Description
-In file included from /build/boost/install_1.66_0_mvapich/include/boost/geometry/algorithms/detail/buffer/buffer_inserter.hpp:34:0,
from /build/boost/install_1.66_0_mvapich/include/boost/geometry/algorithms/buffer.hpp:40, from /build/boost/install_1.66_0_mvapich/include/boost/geometry/geometry.hpp:55, from /build/boost/install_1.66_0_mvapich/include/boost/geometry.hpp:17, from /build/nektar/nektar/library/FieldUtils/ProcessModules/ProcessInterpField.cpp:39:
/build/boost/install_1.66_0_mvapich/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp: In member function ‘void boost::geometry::detail::buffer::buffered_piece_collection<Ring, IntersectionStrategy, RobustPolicy>::discard_turns_for_deflate()’: /build/boost/install_1.66_0_mvapich/include/boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp:606:53: error: parse error in template argument list
if (! prop.has_inflated && prop.count < 3)
-Similar to #13368
Change History (6)
comment:2 by , 5 years ago
Even more distilled sample:
namespace boost { template <typename T> void count(T) { } template <typename T> class A { struct B { int count; }; void foo() { B b; b.count < 3; } }; } int main() {}
It looks like a bug in the compiler.
comment:3 by , 5 years ago
Thanks for the investigation. I found a workaround since its the compiler. update line in buffered_piece_collection.hpp to if (! prop.has_inflated && (prop.count) < 3)
forces the compiler to interpret correctly.
comment:6 by , 5 years ago
Milestone: | To Be Determined → Boost 1.67.0 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed, will try to get it into 1.67 Thanks for the report, the analysis and the workaround
I don't think it's a problem in the Boost.Geometry. Looking at the discussion under the other bug report (#13368) it seems that it depends on the compiler and the order of includes. It looks like
count
is interpreted as a template by the compiler. We could add some workaround but this would be for the problem existing somewhere else. It would be better to find the actual cause.What Boost libraries are you including and in what order?Could you experiment with the order of includes in order to find problematic library?EDIT: It seems that it is related with Boost.Range. Code required to reproduce it looks like this: