public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-9815] c++: add fixed test [PR91079]
@ 2024-04-05 17:44 Marek Polacek
0 siblings, 0 replies; only message in thread
From: Marek Polacek @ 2024-04-05 17:44 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:2b2d3a135a43cbafadd8957e0b2543f38c390437
commit r14-9815-g2b2d3a135a43cbafadd8957e0b2543f38c390437
Author: Marek Polacek <polacek@redhat.com>
Date: Fri Apr 5 13:40:33 2024 -0400
c++: add fixed test [PR91079]
Fixed by r12-2975.
PR c++/91079
DR 1881
gcc/testsuite/ChangeLog:
* g++.dg/ext/is_std_layout5.C: New test.
Diff:
---
gcc/testsuite/g++.dg/ext/is_std_layout5.C | 13 +++++++++++++
1 file changed, 13 insertions(+)
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), "");
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2024-04-05 17:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-05 17:44 [gcc r14-9815] c++: add fixed test [PR91079] Marek Polacek
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).