public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Using [[may_alias]] in C23/C++23 on a union works in neither post-"union" position, or at the end of the definition
@ 2022-12-06  3:17 Gavin Ray
  2022-12-06 16:54 ` Joseph Myers
  0 siblings, 1 reply; 6+ messages in thread
From: Gavin Ray @ 2022-12-06  3:17 UTC (permalink / raw)
  To: gcc

[-- Attachment #1: Type: text/plain, Size: 524 bytes --]

The reproduction is below. Not sure if this is intended or a bug, sorry to
clutter up the mailing list if it's intended!

union __attribute__((may_alias)) works {};

// <source>:3:18: note: attribute for 'union broken2' must follow the
'union' keyword
union broken1 {} [[may_alias]];

// Okay, so let's move it so it follows union...
// <source>:7:21: warning: 'may_alias' attribute directive ignored
[-Wattributes]
//  7 | union [[may_alias]] broken2 {};
//    |                     ^~~~~~~
union [[may_alias]] broken2 {};

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-12-06 20:37 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-06  3:17 Using [[may_alias]] in C23/C++23 on a union works in neither post-"union" position, or at the end of the definition Gavin Ray
2022-12-06 16:54 ` Joseph Myers
2022-12-06 18:35   ` Gavin Ray
2022-12-06 19:23     ` Jonathan Wakely
2022-12-06 20:31       ` Gavin Ray
2022-12-06 20:36         ` Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).