clang++ complains: /usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/ranges:3392:19: error: missing 'typename' prior to dependent type name 'iterator_traits<iterator_t<_Base>>::iterator_category' using _Cat = iterator_traits<iterator_t<_Base>>::iterator_category;
(In reply to Avi Kivity from comment #0) > clang++ complains: > > /usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/ranges:3392: > 19: error: missing 'typename' prior to dependent type name > 'iterator_traits<iterator_t<_Base>>::iterator_category' > using _Cat = > iterator_traits<iterator_t<_Base>>::iterator_category; Clang doesn't fully support the C++20 language features that libstdc++ uses in its implementation (Down with typename!). http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0634r3.html
Yes, this is a gap in clang's C++20 implementation, so we should work around it in libstdc++.
Note, I posted a patch for this to gcc-patches, to save you the effort of typing those 9 letters.
(In reply to Avi Kivity from comment #3) > Note, I posted a patch for this to gcc-patches, to save you the effort of > typing those 9 letters. Ah thanks, I missed that :)
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>: https://gcc.gnu.org/g:5e2e15f212e2458a1258b8c856895c755460bc6b commit r12-1262-g5e2e15f212e2458a1258b8c856895c755460bc6b Author: Avi Kivity <avi@scylladb.com> Date: Mon Jun 7 11:19:05 2021 -0400 libstdc++: add missing typename for dependent type in ranges::elements_view [PR100900] Clang complains about the missing typename. I believe it's not required in a more complete implementation of C++, but it's nicer to support less complete implementations. PR libstdc++/100900 libstdc++-v3/ChangeLog: * include/std/ranges (elements_view::__iter_cat::_S_iter_cat): Add missing typename.
The releases/gcc-11 branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>: https://gcc.gnu.org/g:23fa1e7eab7680ae0488b4c8802b0bcd8f78425d commit r11-8519-g23fa1e7eab7680ae0488b4c8802b0bcd8f78425d Author: Avi Kivity <avi@scylladb.com> Date: Mon Jun 7 11:19:05 2021 -0400 libstdc++: add missing typename for dependent type in ranges::elements_view [PR100900] Clang complains about the missing typename. I believe it's not required in a more complete implementation of C++, but it's nicer to support less complete implementations. PR libstdc++/100900 libstdc++-v3/ChangeLog: * include/std/ranges (elements_view::__iter_cat::_S_iter_cat): Add missing typename. (cherry picked from commit 5e2e15f212e2458a1258b8c856895c755460bc6b)
Patch pushed to trunk and the 11 branch, thanks!
I see you added the changelog entry. I'll be sure to do that next time I post a patch.
Since PR95983 fix was backported to gcc-10 (by commit 1cb39945993c89746b0347746bd1267de85cbc42), please backport this follow-up fix to gcc-10, too.
The releases/gcc-10 branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>: https://gcc.gnu.org/g:e9fbf0f9d621213ea16713b595feb88b789a8858 commit r10-9969-ge9fbf0f9d621213ea16713b595feb88b789a8858 Author: Avi Kivity <avi@scylladb.com> Date: Mon Jun 7 11:19:05 2021 -0400 libstdc++: add missing typename for dependent type in ranges::elements_view [PR100900] Clang complains about the missing typename. I believe it's not required in a more complete implementation of C++, but it's nicer to support less complete implementations. PR libstdc++/100900 libstdc++-v3/ChangeLog: * include/std/ranges (elements_view::__iter_cat::_S_iter_cat): Add missing typename. (cherry picked from commit 5e2e15f212e2458a1258b8c856895c755460bc6b)
(In reply to Dmitry V. Levin from comment #9) > Since PR95983 fix was backported to gcc-10 (by commit > 1cb39945993c89746b0347746bd1267de85cbc42), please backport this follow-up > fix to gcc-10, too. done