]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: Add testcase for CWG3079
authorJakub Jelinek <jakub@redhat.com>
Mon, 17 Nov 2025 14:27:04 +0000 (15:27 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 17 Nov 2025 14:27:04 +0000 (15:27 +0100)
We already implement anonymous unions that way, the following patch
just adds a testcase for it.

2025-11-17  Jakub Jelinek  <jakub@redhat.com>

* g++.dg/DRs/dr3079.C: New test.

gcc/testsuite/g++.dg/DRs/dr3079.C [new file with mode: 0644]

diff --git a/gcc/testsuite/g++.dg/DRs/dr3079.C b/gcc/testsuite/g++.dg/DRs/dr3079.C
new file mode 100644 (file)
index 0000000..5fd26d3
--- /dev/null
@@ -0,0 +1,5 @@
+// DR 3079 - Allow empty-declarations in anonymous unions
+// { dg-do compile { target c++11 } }
+
+struct A { union { int x;; } u; };
+struct B { union { int x;; }; };