Bug 2082521 - Cannot mix GCC and C++11 / C23 attribute syntax.
Summary: Cannot mix GCC and C++11 / C23 attribute syntax.
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Developer Toolset
Classification: Red Hat
Component: gcc
Version: DTS 11.0 RHEL 7
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: alpha
: 9.1
Assignee: Martin Cermak
QA Contact: Martin Cermak
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-05-06 10:22 UTC by pbhosale
Modified: 2023-07-18 14:12 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-06-07 14:02:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 69585 0 P3 RESOLVED [C++ 11] parser errors mixing alignas, C++ 11 and GNU attributes on class declaration 2022-06-07 13:02:08 UTC
Red Hat Issue Tracker DTS-388 0 None None None 2022-05-06 10:53:16 UTC

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.


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