Bug 1597104 - G++ 7.3.1 does not compile c++ code
Summary: G++ 7.3.1 does not compile c++ code
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: gcc
Version: DTS 7.1 RHEL 7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: alpha
: 8.0
Assignee: Marek Polacek
QA Contact: Michael Petlan
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-07-02 04:20 UTC by Ankur deDev
Modified: 2018-11-13 08:38 UTC (History)
8 users (show)

Fixed In Version: devtoolset-8-gcc-8.1.1-5.el7
Doc Type: Bug Fix
Doc Text:
Previously, G++ could reject valid code using a functional cast in template noexcept-specifier. The bug has been fixed and the code can now be compiled.
Clone Of:
Environment:
Last Closed: 2018-11-13 08:38:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Test case to reproduce issue (1.13 KB, text/x-csrc)
2018-07-02 04:20 UTC, Ankur deDev
no flags Details


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 86378 0 None None None 2018-07-02 19:07:25 UTC
Red Hat Product Errata RHBA-2018:3562 0 None None None 2018-11-13 08:38:56 UTC

Description Ankur deDev 2018-07-02 04:20:28 UTC
Created attachment 1455858 [details]
Test case to reproduce issue

Description of problem:
C++ code does not compile.

Version-Release number of selected component (if applicable):
g++ (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5).

Steps to Reproduce:
1. Download test.cpp attachment
2. Run command: scl enable devtoolset-7 'bash'
3. Compile the attachment: g++ test.cpp

Actual results:
test.cpp: In instantiation of ‘constexpr Combination<FRUIT, SPICE>::Combination(SPICE&&, ARGS&& ...) [with ARGS = {Pepper}; FRUIT = Apple; SPICE = Pepper]’:
test.cpp:35:13:   required from ‘constexpr MyCombination::MyCombination(ARGS&& ...) [with ARGS = {Apple}]’
test.cpp:47:29:   required from here
test.cpp:18:29: error: no matching function for call to ‘Apple::Apple(Pepper)’
     , SPICE(std::move(spice))
...

Expected results:
Should compile without errors or warnings as is the case with g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28): g++ -std=c++11 test.cpp

Comment 2 Marek Polacek 2018-07-02 18:37:24 UTC
Reproduced with trunk; I'll take this upstream.

Comment 3 Jason Merrill 2018-07-03 16:29:21 UTC
Fixed upstream.

Comment 5 Michael Petlan 2018-11-08 15:51:32 UTC
VERIFIED for devtoolset-8-gcc-8.2.1-3.

Comment 7 errata-xmlrpc 2018-11-13 08:38:37 UTC
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


Note You need to log in before you can comment on or make changes to this bug.