Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 842405 - <sys-devel/gcc-{10.3.1_p20220616, 11.3.1_p20220617}: experimental/bits/fs_path.h has inconsistent definition of iterator path::begin()
Summary: <sys-devel/gcc-{10.3.1_p20220616, 11.3.1_p20220617}: experimental/bits/fs_pat...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-05-03 09:29 UTC by Agostino Sarubbo
Modified: 2023-01-24 10:57 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,138.96 KB, text/plain)
2022-05-03 09:29 UTC, Agostino Sarubbo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2022-05-03 09:29:44 UTC
https://blogs.gentoo.org/ago/2020/07/04/gentoo-tinderbox/

Issue: sci-libs/hipSPARSE-5.0.2 fails to compile.
Discovered on: amd64 (internal ref: ci)
Comment 1 Agostino Sarubbo gentoo-dev 2022-05-03 09:29:47 UTC
Created attachment 776423 [details]
build.log

build log and emerge --info
Comment 2 Agostino Sarubbo gentoo-dev 2022-05-03 09:29:48 UTC
Error(s) that match a know pattern in addition to what has been reported in the summary:


FAILED: clients/tests/CMakeFiles/hipsparse-test.dir/__/common/utility.cpp.o 
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/include/g++-v11/experimental/bits/fs_path.h:1209:9: error: 'begin' is missing exception specification 'noexcept'
Comment 3 Yiyang Wu 2022-06-10 07:40:26 UTC
This bug is caused by clang-14 and clang-13 cannot compile gcc-11.3 experimental/filesystem.

A minimum reproduction is:

```c++
#include <iostream>
#include <experimental/filesystem>

int main()
{
        std::cout<<"Hi"<<std::endl;
}

Compile with clang-14 returns:

```
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.1/include/g++-v11/experimental/bits/fs_path.h:1209:9: error: 'begin' is missing exception specification 'noexcept'
  path::begin() const
        ^
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.1/include/g++-v11/experimental/bits/fs_path.h:428:14: note: previous declaration is here
    iterator begin() const noexcept;
             ^
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.1/include/g++-v11/experimental/bits/fs_path.h:1217:9: error: 'end' is missing exception specification 'noexcept'
  path::end() const
        ^
/usr/lib/gcc/x86_64-pc-linux-gnu/11.3.1/include/g++-v11/experimental/bits/fs_path.h:429:14: note: previous declaration is here
    iterator end() const noexcept;
             ^
2 errors generated.
```

Both =sys-devel/gcc-11.3.0 and =sys-devel/gcc-11.3.1_p20220603 can cause the issue. gcc-11.2 does not suffer, because:

--- 11.2.1/include/g++-v11/experimental/bits/fs_path.h
+++ 11.3.1/include/g++-v11/experimental/bits/fs_path.h
@@ -425,8 +425,8 @@ namespace __detail
     class iterator;
     typedef iterator const_iterator;

-    iterator begin() const;
-    iterator end() const;
+    iterator begin() const noexcept;
+    iterator end() const noexcept;

     /// @cond undocumented
     // Create a basic_string by reading until a null character.
Comment 4 Benda Xu gentoo-dev 2022-06-10 09:31:46 UTC
The corresponding upstream commits are

https://github.com/gcc-mirror/gcc/commit/944da70a5d1cdc5bd4327b2d32420f57b6883985

and 

https://github.com/gcc-mirror/gcc/commit/42eff613d0c10f88dc7a44b14981876401a09981


It is a surprise that the headers are still not consistent.
Comment 5 Benda Xu gentoo-dev 2022-06-10 09:57:24 UTC
(In reply to Benda Xu from comment #4)
> The corresponding upstream commits are
> 
> https://github.com/gcc-mirror/gcc/commit/
> 944da70a5d1cdc5bd4327b2d32420f57b6883985
> 
> and 
> 
> https://github.com/gcc-mirror/gcc/commit/
> 42eff613d0c10f88dc7a44b14981876401a09981
> 
> 
> It is a surprise that the headers are still not consistent.

The 42eff613d0 commit is a sequel of 944da70a, but gcc-11.3.0 only have the former but not the latter.
Comment 6 Benda Xu gentoo-dev 2022-06-10 11:22:53 UTC
Hi Toolchain Team,

I have confirmed that this is a gcc bug.

> The 42eff613d0 commit is a sequel of 944da70a, but gcc-11.3.0 only have the former but not the latter.

In my previous comment, the two commits should have been reversed.  944da70a (authored on 2021-09-17) is the sequel of 42eff613d0 (on 2022-04-01).  By applying 

By applying 42eff613d0c10f88 to gcc-11.3.0, both hipSPARSE and rocSPARSE can compile.
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-06-10 11:24:02 UTC
(In reply to Benda Xu from comment #6)
> Hi Toolchain Team,
> 
> I have confirmed that this is a gcc bug.
> 
> > The 42eff613d0 commit is a sequel of 944da70a, but gcc-11.3.0 only have the former but not the latter.
> 
> In my previous comment, the two commits should have been reversed.  944da70a
> (authored on 2021-09-17) is the sequel of 42eff613d0 (on 2022-04-01).  By
> applying 
> 
> By applying 42eff613d0c10f88 to gcc-11.3.0, both hipSPARSE and rocSPARSE can
> compile.

Thanks. As per my github comment on the PR, please report this upstream on their Bugzilla and link it here if you can. You're able to better describe the issue than I can as you've just looked into it. Thanks a lot!
Comment 8 Benda Xu gentoo-dev 2022-06-10 11:25:20 UTC
(In reply to Benda Xu from comment #6)
> Hi Toolchain Team,
> 
> I have confirmed that this is a gcc bug.
> 
> > The 42eff613d0 commit is a sequel of 944da70a, but gcc-11.3.0 only have the former but not the latter.
> 
> In my previous comment, the two commits should have been reversed.  944da70a
> (authored on 2021-09-17) is the sequel of 42eff613d0 (on 2022-04-01).  By
> applying 

My bad.... 944da70a (authored on 2021-09-27) is the sequel of 42eff613d0 (on 2021-09-17).