range-v3
range-v3 copied to clipboard
Cannot compile 0.11.0 with clang 13.0 + libc++
clang 12.0.1 + libc++ is ok. clang 13.0 + libstdc++ is ok. clang 13.0 + libc++ is failed to compile with the simplest demo.
#include <iostream>
#include <string>
#include <vector>
#include <range/v3/view/filter.hpp>
#include <range/v3/view/transform.hpp>
using namespace ranges;
using std::cout;
int main()
{
std::vector<int> const vi{1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
auto rng = vi | views::filter([](int i) { return i % 2 == 0; }) |
views::transform([](int i) { return std::to_string(i); });
cout << rng << '\n';
}
clang++ -std=c++2b -stdlib=libc++ main.cpp
In file included from main.cpp:5:
In file included from /usr/local/include/range/v3/view/filter.hpp:23:
In file included from /usr/local/include/range/v3/view/remove_if.hpp:27:
In file included from /usr/local/include/range/v3/range/access.hpp:34:
In file included from /usr/local/include/range/v3/iterator/concepts.hpp:30:
In file included from /usr/local/include/range/v3/iterator/access.hpp:22:
/usr/local/include/std/detail/associated_types.hpp:270:60: error: too many template arguments for class template '__iterator_traits'
&is_std_iterator_traits_specialized_impl_(std::__iterator_traits<I, B> *))[2];
^ ~~
/usr/local/bin/../include/c++/v1/__iterator/iterator_traits.h:326:8: note: template is declared here
struct __iterator_traits {};
^
1 error generated.
See also: https://godbolt.org/z/qbjnETEWY
This a dupe of https://github.com/ericniebler/range-v3/issues/1633 fixed in https://github.com/ericniebler/range-v3/pull/1635
I see, so it's fixed in master, just not released. Thanks for finding that out. So the only problem is, that the latest release of range-v3 now doesn't work with the latest release of Clang.
Please note that same fix as in #1635 applies to include/std/iterator
when compiled with -DRANGES_DEEP_STL_INTEGRATION