Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

missing `typename` in gcc 11.1.0 ranges header

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?

like image 245
Zuodian Hu Avatar asked Jan 19 '26 21:01

Zuodian Hu


1 Answers

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.