Boost logo

Boost :

Subject: [boost] [teeks99-09-p-win2016-64on64][poly_collection] Regression with latest MSVC 14.1 in C++17 mode
From: Joaquin M López Muñoz (joaquinlopezmunoz_at_[hidden])
Date: 2018-02-28 08:51:28


Hi,

MSVC 14.1 (_MSC_FULL_VER=191225834) in C++17 mode (_MSVC_LANG=201704L)
is having a regression when compiling Boost.PolyCollection tests:

http://www.boost.org/development/tests/develop/developer/output/teeks99-09-p-win2016-64on64-boost-bin-v2-libs-poly_collection-test-test_algorithm-test-msvc-14-1-dbg-adrs-mdl-64-thrd-mlt.html

The problem happens in this seemingly innocent context
(https://github.com/boostorg/poly_collection/blob/654018c7ce14674a1c0527206ad11c8d98b9aae8/test/test_algorithm_impl.hpp#L209-L242
):

 Â  template<
 Â Â Â  typename ForwardIterator1,typename ForwardIterator2,typename Predicate
 Â  >
 Â  bool operator()(
 Â Â Â  ForwardIterator1 first1,ForwardIterator1 last1,
 Â Â Â  ForwardIterator2 first2,Predicate pred)const
 Â  {
 Â Â Â  ...
 Â Â Â  using difference_type=
 Â Â Â Â Â  typename std::iterator_traits<ForwardIterator1>::difference_type;

 Â Â Â  difference_type l1=std::distance(first1,last1); // syntax error
(wrongly) signalled here

Is there some kind soul with access to this compiler who'd like to try
the following
workarounds and report the results?

 Â Â Â  // workaround 1
 Â Â Â  using difference_type=
 Â Â Â Â Â  typename std::iterator_traits<ForwardIterator1>::difference_type;

 Â Â Â  typename difference_type l1=std::distance(first1,last1);

 Â Â Â  // workaround 2
 Â Â Â  typedef  typename
std::iterator_traits<ForwardIterator1>::difference_type difference_type;

 Â Â Â  difference_type l1=std::distance(first1,last1);

Thank you!

Joaquín M López Muñoz


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk