Summary: | clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category' | ||
---|---|---|---|
Product: | gcc | Reporter: | gcc-bugzilla |
Component: | libstdc++ | Assignee: | Jonathan Wakely <redi> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | webrown.cpp |
Priority: | P3 | Keywords: | rejects-valid |
Version: | 13.2.1 | ||
Target Milestone: | 13.3 | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2023-08-10 00:00:00 |
Description
gcc-bugzilla
2023-08-10 09:52:43 UTC
Clang 15, I assume? Yes, apologies for the missing information clang version 15.0.7 g++ (GCC) 13.2.1 20230801 (Arch) According to https://clang.llvm.org/cxx_status.html P0634R3 / "Down with typename!" is implemented since Clang 16 (released in March). So maybe this is actually not a problem for much longer. Might only affect the combination of a very recent GCC with slightly outdated Clang. We aim to support at least two versions of Clang, so we have to wait for 17 before we can consider 15 too old. That said, the combination of the newest -std and not-the-latest Clang is usually going to be a bit risky. Anyway, I have a patch to fix this, which also cleans the code up a little. The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:9cb2a7c8d54b1f6685bc509a07104c458262cb9f commit r14-3134-g9cb2a7c8d54b1f6685bc509a07104c458262cb9f Author: Jonathan Wakely <jwakely@redhat.com> Date: Thu Aug 10 13:48:48 2023 +0100 libstdc++: Use alias template for iterator_category [PR110970] This renames __iterator_category_t to __iter_category_t, for consistency with std::iter_value_t, std::iter_difference_t and std::iter_reference_t in C++20. Then use __iter_category_t in <bits/stl_iterator.h>, which fixes the problem of the missing 'typename' that Clang 15 incorrectly still requires. libstdc++-v3/ChangeLog: PR libstdc++/110970 * include/bits/stl_iterator.h (__detail::__move_iter_cat): Use __iter_category_t. (iterator_traits<common_iterator<I, S>>::_S_iter_cat): Likewise. (__detail::__basic_const_iterator_iter_cat): Likewise. * include/bits/stl_iterator_base_types.h (__iterator_category_t): Rename to __iter_category_t. The releases/gcc-13 branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>: https://gcc.gnu.org/g:2e094543715fbd1a5486d77dcbfeec52d86aba61 commit r13-7710-g2e094543715fbd1a5486d77dcbfeec52d86aba61 Author: Jonathan Wakely <jwakely@redhat.com> Date: Thu Aug 10 13:48:48 2023 +0100 libstdc++: Use alias template for iterator_category [PR110970] This renames __iterator_category_t to __iter_category_t, for consistency with std::iter_value_t, std::iter_difference_t and std::iter_reference_t in C++20. Then use __iter_category_t in <bits/stl_iterator.h>, which fixes the problem of the missing 'typename' that Clang 15 incorrectly still requires. libstdc++-v3/ChangeLog: PR libstdc++/110970 * include/bits/stl_iterator.h (__detail::__move_iter_cat): Use __iter_category_t. (iterator_traits<common_iterator<I, S>>::_S_iter_cat): Likewise. (__detail::__basic_const_iterator_iter_cat): Likewise. * include/bits/stl_iterator_base_types.h (__iterator_category_t): Rename to __iter_category_t. (cherry picked from commit 9cb2a7c8d54b1f6685bc509a07104c458262cb9f) Fixed for 13.3, thanks for the report. |