[gcc r16-5339] c++: Add testcase for CWG3079

Jakub Jelinek jakub@gcc.gnu.org
Mon Nov 17 14:27:56 GMT 2025


https://gcc.gnu.org/g:9acc6d887647301a2d1c6b3559d16996c47f0801

commit r16-5339-g9acc6d887647301a2d1c6b3559d16996c47f0801
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Mon Nov 17 15:27:04 2025 +0100

    c++: Add testcase for CWG3079
    
    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.

Diff:
---
 gcc/testsuite/g++.dg/DRs/dr3079.C | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gcc/testsuite/g++.dg/DRs/dr3079.C b/gcc/testsuite/g++.dg/DRs/dr3079.C
new file mode 100644
index 000000000000..5fd26d3603e6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/DRs/dr3079.C
@@ -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;; }; };


More information about the Gcc-cvs mailing list