summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/union.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/union.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/union.C11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/union.C b/gcc/testsuite/g++.old-deja/g++.jason/union.C
new file mode 100644
index 000000000..21a0b6f7a
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/union.C
@@ -0,0 +1,11 @@
+// { dg-do assemble }
+// Bug: g++ doesn't insert anon union members into class scope.
+// Breaks groff.
+
+struct A {
+ union {
+ int i;
+ };
+
+ void foo () { i = 1; } // { dg-bogus "" }
+};