public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/110970] New: clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category'
@ 2023-08-10  9:52 gcc-bugzilla at zulan dot net
  2023-08-10 12:29 ` [Bug libstdc++/110970] " redi at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: gcc-bugzilla at zulan dot net @ 2023-08-10  9:52 UTC (permalink / raw)
  To: gcc-bugs

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 <algorithm>" | clang++ -std=c++2b -stdlib=libstdc++ -c -x c++ -
In file included from <stdin>: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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/110970] clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category'
  2023-08-10  9:52 [Bug libstdc++/110970] New: clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category' gcc-bugzilla at zulan dot net
@ 2023-08-10 12:29 ` redi at gcc dot gnu.org
  2023-08-10 12:36 ` gcc-bugzilla at zulan dot net
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2023-08-10 12:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110970

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2023-08-10

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Clang 15, I assume?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/110970] clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category'
  2023-08-10  9:52 [Bug libstdc++/110970] New: clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category' gcc-bugzilla at zulan dot net
  2023-08-10 12:29 ` [Bug libstdc++/110970] " redi at gcc dot gnu.org
@ 2023-08-10 12:36 ` gcc-bugzilla at zulan dot net
  2023-08-10 12:55 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: gcc-bugzilla at zulan dot net @ 2023-08-10 12:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110970

--- Comment #2 from gcc-bugzilla at zulan dot net ---
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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/110970] clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category'
  2023-08-10  9:52 [Bug libstdc++/110970] New: clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category' gcc-bugzilla at zulan dot net
  2023-08-10 12:29 ` [Bug libstdc++/110970] " redi at gcc dot gnu.org
  2023-08-10 12:36 ` gcc-bugzilla at zulan dot net
@ 2023-08-10 12:55 ` redi at gcc dot gnu.org
  2023-08-10 22:32 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2023-08-10 12:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110970

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |rejects-valid
             Status|NEW                         |ASSIGNED
   Target Milestone|---                         |13.3
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/110970] clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category'
  2023-08-10  9:52 [Bug libstdc++/110970] New: clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category' gcc-bugzilla at zulan dot net
                   ` (2 preceding siblings ...)
  2023-08-10 12:55 ` redi at gcc dot gnu.org
@ 2023-08-10 22:32 ` cvs-commit at gcc dot gnu.org
  2023-08-11 15:36 ` cvs-commit at gcc dot gnu.org
  2023-08-11 15:37 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-10 22:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110970

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/110970] clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category'
  2023-08-10  9:52 [Bug libstdc++/110970] New: clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category' gcc-bugzilla at zulan dot net
                   ` (3 preceding siblings ...)
  2023-08-10 22:32 ` cvs-commit at gcc dot gnu.org
@ 2023-08-11 15:36 ` cvs-commit at gcc dot gnu.org
  2023-08-11 15:37 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-08-11 15:36 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110970

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
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)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug libstdc++/110970] clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category'
  2023-08-10  9:52 [Bug libstdc++/110970] New: clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category' gcc-bugzilla at zulan dot net
                   ` (4 preceding siblings ...)
  2023-08-11 15:36 ` cvs-commit at gcc dot gnu.org
@ 2023-08-11 15:37 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2023-08-11 15:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110970

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #6 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed for 13.3, thanks for the report.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-08-11 15:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-10  9:52 [Bug libstdc++/110970] New: clang / c++23 missing 'typename' prior to dependent type name 'iterator_traits<_It>::iterator_category' gcc-bugzilla at zulan dot net
2023-08-10 12:29 ` [Bug libstdc++/110970] " redi at gcc dot gnu.org
2023-08-10 12:36 ` gcc-bugzilla at zulan dot net
2023-08-10 12:55 ` redi at gcc dot gnu.org
2023-08-10 22:32 ` cvs-commit at gcc dot gnu.org
2023-08-11 15:36 ` cvs-commit at gcc dot gnu.org
2023-08-11 15:37 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).