Bug 1971443

Summary: clang / libstdc++: missing typename when compiling with <ranges> and -std=c++2a
Product: [Fedora] Fedora Reporter: Marián Konček <mkoncek>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 34CC: aoliva, avi.kivity, dmalcolm, fweimer, jakub, jwakely, law, mpolacek, msebor, nickc, sipoyare
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: gcc-11.2.1-1.fc34 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-01 04:04:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marián Konček 2021-06-14 05:58:33 UTC
Compile the following file:
```
#include <ranges>
int main() {}
```

using:
$ clang++ -std=c++2a file.cpp

You will get an error:

/usr/lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/ranges:3466: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;

This renders clang unusable for any code that includes ranges and compiles with c++20 flags because clang hasn't implemented P0634R3.

The very simple fix is to add Fedora-speciffic patch which simply adds the typename into libstdc++.

Comment 1 Jonathan Wakely 2021-06-14 09:05:30 UTC
(In reply to Marián Konček from comment #0)
> The very simple fix is to add Fedora-speciffic patch which simply adds the
> typename into libstdc++.

No, because Fedora's policy is upstream first (and it's already fixed upstream).

Comment 2 Jonathan Wakely 2021-07-12 09:45:20 UTC
*** Bug 1981085 has been marked as a duplicate of this bug. ***

Comment 3 Avi Kivity 2021-07-18 10:10:09 UTC
The patch is now upstream, so a refresh of the Fedora package will bring it in.

Comment 4 Fedora Update System 2021-07-29 08:20:55 UTC
FEDORA-2021-32bc696c85 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-32bc696c85

Comment 5 Fedora Update System 2021-07-30 01:46:36 UTC
FEDORA-2021-32bc696c85 has been pushed to the Fedora 34 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-32bc696c85`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-32bc696c85

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2021-08-01 04:04:57 UTC
FEDORA-2021-32bc696c85 has been pushed to the Fedora 34 stable repository.
If problem still persists, please make note of it in this bug report.