Bug 2082521

Summary: Cannot mix GCC and C++11 / C23 attribute syntax.
Product: Red Hat Developer Toolset Reporter: pbhosale
Component: gccAssignee: Martin Cermak <mcermak>
gcc sub component: gcc-toolset-12 QA Contact: Martin Cermak <mcermak>
Status: CLOSED NEXTRELEASE Docs Contact:
Severity: medium    
Priority: unspecified CC: dmalcolm, jakub, mcermak, mnewsome, mpolacek, ohudlick, sipoyare
Version: DTS 11.0 RHEL 7Keywords: Bugfix, Triaged
Target Milestone: alpha   
Target Release: 9.1   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-06-07 14:02:26 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 pbhosale 2022-05-06 10:22:12 UTC
Description of problem:


GCC from DTS 11 on RHEL 7.9 rejects __attribute__((visibility("default"))) and C++11 / C23 attribute [[nodiscard]] for struct and class but accept the same mix for function.

The issue is already known:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102399

Version-Release number of selected component (if applicable):


How reproducible:
when user try to use [[nodiscard]]  attribute on struct or class already having __attribute__((visibility("default")))

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Marek Polacek 2022-05-06 13:39:46 UTC
I think this will be CLOSED|UPSTREAM, because even if we fix it in upstream, it would be only fixed in DTS13.

Comment 2 Marek Polacek 2022-06-07 13:44:55 UTC
I've fixed this in GCC 13.  Since the patch is simple, I could backport to DTS/GTS 12.  Is this important enough to warrant the backports?

Comment 3 Jakub Jelinek 2022-06-07 13:55:14 UTC
I'd worry if upstream GCC 12 and DTS/GTS 12 differed in something so much user visible like this.  People who develop on DTS/GTS would then be surprised it doesn't work with GCC 12 elsewhere.

Comment 4 Marek Polacek 2022-06-07 14:02:26 UTC
In that case let's not do the backports.  Therefore this will be fixed in GTS 13.