]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR c++/20142 (implicit assignment operator with multi-dimensional array is broken)
authorMark Mitchell <mmitchel@gcc.gnu.org>
Wed, 9 Mar 2005 07:39:48 +0000 (07:39 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Wed, 9 Mar 2005 07:39:48 +0000 (07:39 +0000)
PR c++/20142
* g++.dg/init/array18.C: New test.

From-SVN: r96177

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

diff --git a/gcc/testsuite/g++.dg/init/array18a.C b/gcc/testsuite/g++.dg/init/array18a.C
new file mode 100644 (file)
index 0000000..154d03f
--- /dev/null
@@ -0,0 +1,22 @@
+// PR c++/20142
+// { dg-do run }
+
+int n=4;
+
+struct A
+{
+  A() {}
+  A& operator= (const A&) { --n; return *this; }
+};
+
+struct B
+{
+  A x[2][2];
+};
+
+int main()
+{
+  B b;
+  b = b;
+  return n;
+}