From: Marek Polacek <polacek@redhat.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [pushed] c++: add fixed test [PR91079]
Date: Fri, 5 Apr 2024 13:43:36 -0400 [thread overview]
Message-ID: <20240405174336.54500-1-polacek@redhat.com> (raw)
Tested x86_64-pc-linux-gnu, applying to trunk.
-- >8 --
Fixed by r12-2975.
PR c++/91079
DR 1881
gcc/testsuite/ChangeLog:
* g++.dg/ext/is_std_layout5.C: New test.
---
gcc/testsuite/g++.dg/ext/is_std_layout5.C | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 gcc/testsuite/g++.dg/ext/is_std_layout5.C
diff --git a/gcc/testsuite/g++.dg/ext/is_std_layout5.C b/gcc/testsuite/g++.dg/ext/is_std_layout5.C
new file mode 100644
index 00000000000..875f3c0948d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/is_std_layout5.C
@@ -0,0 +1,13 @@
+// PR c++/91079
+// DR 1881 - Standard-layout classes and unnamed bit-fields
+// { dg-do compile { target c++11 } }
+
+struct A { int a : 4; };
+struct B : A { int b : 3; };
+static_assert(__is_standard_layout(A), "");
+static_assert(!__is_standard_layout(B), "");
+
+struct C { int : 0; };
+struct D : C { int : 0; };
+static_assert(__is_standard_layout(C), "");
+static_assert(!__is_standard_layout(D), "");
base-commit: e7d015b2506a1d9e84d9f7182e42e097147527e1
--
2.44.0
reply other threads:[~2024-04-05 17:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240405174336.54500-1-polacek@redhat.com \
--to=polacek@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).