https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110970
Bug ID: 110970
Summary: clang / c++23 missing 'typename' prior to dependent
type name 'iterator_traits<_It>::iterator_category'
Product: gcc
Version: 13.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: libstdc++
Assignee: unassigned at gcc dot gnu.org
Reporter: gcc-bugzilla at zulan dot net
Target Milestone: ---
Using clang with the current libstdc++ and c++23 (2b) fails:
echo "#include " | clang++ -std=c++2b -stdlib=libstdc++ -c -x c++ -
In file included from :1:
In file included from
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/algorithm:60:
In file included from
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/bits/stl_algobase.h:67:
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/13.2.1/../../../../include/c++/13.2.1/bits/stl_iterator.h:2618:35:
error: missing 'typename' prior to dependent type name
'iterator_traits<_It>::iterator_category'
{ using iterator_category = iterator_traits<_It>::iterator_category; };
The line is unchanged in the current git, so I presume this is not fixed yet.
Simply adding `typename` to the line does fix the issue with clang.
This is similar to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100900. I won't
try to language lawyer what is technically correct here. In the other issue it
was decided to be nice and support other implementations even though it is a
(very low cost) workaround.