Bug 1562745
Summary: | GCC 7.2 compilation fails over noexcept | ||
---|---|---|---|
Product: | Red Hat Developer Toolset | Reporter: | Piyush Bhoot <pbhoot> |
Component: | gcc | Assignee: | Marek Polacek <mpolacek> |
Status: | CLOSED ERRATA | QA Contact: | Michael Petlan <mpetlan> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | DTS 7.1 RHEL 7 | CC: | jakub, jason, jwakely, kanderso, law, mcermak, mnewsome, mpetlan, ohudlick |
Target Milestone: | alpha | ||
Target Release: | 7.1 | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | devtoolset-8-gcc-8.1.1-5.el7 | Doc Type: | Bug Fix |
Doc Text: |
Previously, the compiler rejected code that contained multiple declarations of malloc, with different non-throwing exception specification, that had been accepted. The problem occurred when merging the two declarations. The code has been adjusted in such a way that the two declarations are merged properly and the code compiles.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2018-11-13 08:38:30 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
Piyush Bhoot
2018-04-02 10:49:59 UTC
The reason we're seeing an error here is that since C++17 'noexcept' is now part of the type system, which means that e.g. void call (void (*)() noexcept); void f (); void bar () { call (f); } doesn't compile in C++17, but this is only enforced in G++ 7 and newer (starting with https://gcc.gnu.org/r241944). A noexcept function can be converted to non-noexcept, but not the other way around--hence the invalid conversion from 'void* (*)(long unsigned int)' to 'void* (*)(long unsigned int) noexcept'. I think the solution is to add a new noexcept overload, or add the noexcept specifier. Your testcase will compile with G++ 7 with -fno-builtin-malloc, because then the non-noexcept version of malloc defined in the program will be used. Fixed upstream in gcc.gnu.org/r259042 Fixed. VERIFIED for devtoolset-8-gcc-8.2.1-3. Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:3562 |