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:
I think this will be CLOSED|UPSTREAM, because even if we fix it in upstream, it would be only fixed in DTS13.
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?
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.
In that case let's not do the backports. Therefore this will be fixed in GTS 13.