Commit 32d3f634 by Brian R. Gaeke Committed by Alexandre Oliva

* g++.dg/other/copy2.C: New test.

From-SVN: r53692
parent c8a3d889
Tue May 21 14:25:32 2002 Brian R. Gaeke <brg@dgate.ORG>
* g++.dg/other/copy2.C: New test.
Mon May 20 10:51:35 2002 J"orn Rennecke <joern.rennecke@superh.com>
* gcc.c-torture/execute/memcpy-2.c (SEQUENCE_LENGTH): Define.
......
// { dg-do run }
// Test that A's copy assignment method is called when B's instance
// member array of A is assigned.
// Contributed by Brian Gaeke, public domain.
int status = 1;
class A
{
public:
int i;
A &operator =(const A &i)
{
status = 0;
}
};
class B
{
public:
A arr[10];
};
int main (int argc, char **argv)
{
B b;
b.arr[0].i = 15;
B a;
a = b; // trigger copy assignment
return status;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment