3

I'm using clang-12.0.1 and libstdc++ from gcc-11.1.0. When including <ranges>, I get the following error:

[build] /usr/local/bin/../lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../include/c++/11.1.0/ranges:3392:19: error: missing 'typename' prior to dependent type name 'iterator_traits<iterator_t<_Base>>::iterator_category'
[build]             using _Cat = iterator_traits<iterator_t<_Base>>::iterator_category;
[build]                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Is this a library bug?

Zuodian Hu
  • 979
  • 4
  • 9

1 Answers1

3

Clang has not implemented P0634R3 yet, as per the current posted status.

So to answer your question:

Is this a library bug?

Nope! Since the ranges library is only available in C++20, GCC's implementation is free to use syntax that is only available as per that version of the standard.

  • Cool, I remember that proposal but didn't check `clang`'s progress on it. Thanks! – Zuodian Hu Aug 22 '21 at 05:07
  • It is worth noting that [the authors of libstdc++ are aware of this problem](https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100900), but they do not have enough time to work around the entire ``. – 康桓瑋 Aug 23 '21 at 15:10