Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#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:1 by awulkiew, 5 years ago

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:

#include <boost/range/algorithm/count.hpp>
#include <boost/geometry/algorithms/detail/buffer/buffered_piece_collection.hpp>

int main()
{}
Last edited 5 years ago by awulkiew (previous) (diff)

comment:2 by awulkiew, 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.

Last edited 5 years ago by awulkiew (previous) (diff)

comment:3 by anonymous, 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:4 by anonymous, 5 years ago

bug also occurs with gcc 5.4

comment:5 by anonymous, 5 years ago

Seconding that this bug exists in gcc 5.5

comment:6 by Barend Gehrels, 5 years ago

Milestone: To Be DeterminedBoost 1.67.0
Resolution: fixed
Status: newclosed

Fixed, will try to get it into 1.67 Thanks for the report, the analysis and the workaround

Last edited 5 years ago by Barend Gehrels (previous) (diff)
Note: See TracTickets for help on using tickets.