summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/anon.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.jason/anon.C')
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/anon.C19
1 files changed, 19 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/anon.C b/gcc/testsuite/g++.old-deja/g++.jason/anon.C
new file mode 100644
index 000000000..e970359f8
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.jason/anon.C
@@ -0,0 +1,19 @@
+// { dg-do run }
+// Bug: g++ has trouble copying anonymous structs.
+
+typedef struct { int i; } foo;
+struct A : public foo {
+ struct { int i; } x;
+};
+
+int main ()
+{
+ A a;
+ a.i = 5;
+ a.x.i = 42;
+ A b (a);
+ a = b;
+ if (a.i != 5 || a.x.i != 42)
+ return 1;
+ return 0;
+}