public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Alignas attribute for enums
@ 2023-03-31 16:42 Fahad Nayyar
  0 siblings, 0 replies; only message in thread
From: Fahad Nayyar @ 2023-03-31 16:42 UTC (permalink / raw)
  To: gcc-help; +Cc: Fahad Nayyar

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

Hey,

I wanted to ask, does gcc allow alignas attribute for enums?

I can see this in some of the test cases in the gcc test suite:
https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/g%2B%2B.dg/cpp0x/alignas7.C#L7
https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/g%2B%2B.dg/cpp0x/alignas15.C#L4
https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/g%2B%2B.dg/cpp2a/is-layout-compatible3.C#L37

I think it is not allowed from c++20 onwards:
https://cplusplus.github.io/CWG/issues/2354.html

kind regards
Fahad

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-03-31 16:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-31 16:42 Alignas attribute for enums Fahad Nayyar

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).