Bug 965339
Summary: | set::erase(position) is ABI-incompatible between C++98 and C++11 | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Josh Stone <jistone> |
Component: | gcc | Assignee: | Jakub Jelinek <jakub> |
Status: | CLOSED WONTFIX | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | 18 | CC: | bill, jakub, jason, law, mnewsome |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | i686 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2014-02-05 23:25:49 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
Josh Stone
2013-05-21 00:46:33 UTC
The result is the same on rawhide, libstdc++-4.8.0-6.fc20.i686. Also, the GCC wiki does mention the change in set::erase, but supposes it's ok because of the const_iterator difference. I expect that was the intention of the standards committee when making this change, but as I noted above, the set::iterator typedef breaks this distinction. http://gcc.gnu.org/wiki/Cxx11AbiCompatibility Confirmed as upstream issue on i686. On x86_64 getting lucky with layout sidesteps the issue. This is from the DR 130 resolution. Return types are not mangled, but changed between the two dialects, thus this issue. Bummer. For anyone like me who is unfamiliar, this is DR 130: http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-defects.html#130 DR 103 is also relevant for the immutable set::iterator type: http://www.open-std.org/JTC1/SC22/WG21/docs/lwg-defects.html#103 That added for containers like set, "It is unspecified whether or not iterator and const_iterator are the same type." It seems this bug demonstrates why they ought to be made distinct, but I guess that would change ABI across the board. Nice job reporting this Josh, and thanks for the clear example. In 4.8.x we can use an abi_tag to change the mangled name of the C++11 version... Nice, abi_tag sounds perfectly appropriate to me. And just for completeness, I tested and confirmed that a multiset version of the given example exhibits the same issue. Here is the patch for trunk: http://gcc.gnu.org/ml/gcc-patches/2013-06/msg00548.html Soon to be on 4.8 branch. This message is a reminder that Fedora 18 is nearing its end of life. Approximately 4 (four) weeks from now Fedora will stop maintaining and issuing updates for Fedora 18. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as WONTFIX if it remains open with a Fedora 'version' of '18'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Fedora version prior to Fedora 18's end of life. Thank you for reporting this issue and we are sorry that we may not be able to fix it before Fedora 18 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora, you are encouraged change the 'version' to a later Fedora version prior to Fedora 18's end of life. Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Fedora release includes newer upstream software that fixes bugs or makes them obsolete. Fedora 18 changed to end-of-life (EOL) status on 2014-01-14. Fedora 18 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora please feel free to reopen this bug against that version. If you are unable to reopen this bug, please file a new report against the current release. If you experience problems, please add a comment to this bug. Thank you for reporting this bug and we are sorry it could not be fixed. I guess Ben just forgot to update this, but FWIW this is fine on F20 libstdc++-4.8.2-7.fc20.i686, and probably also F19 as it has the same version. |