1// { dg-do run } 2// GROUPS passed copy-ctors 3#include <stdio.h> 4 5int pass = 0; 6class name { 7 int namestuff; 8public: 9 name() { 10 namestuff = 111; 11 } 12 name(const name& subject); 13 14 name & operator = (const name& right) { 15 this->namestuff = right.namestuff; 16 return *this; 17 } 18 19 ~name() { 20 ; 21 } 22}; 23 24name::name(const name& subject) { 25 pass = 1; 26} 27 28class person { 29 int personstuff; 30 name personname; 31public: 32 person() { 33 ; 34 personstuff = 222; 35 } 36 ~person() { 37 ; 38 } 39 void print() { 40 ; 41 } 42 43}; 44 45void 46test(person argp) 47{ 48 person testp; 49 50 ; 51 argp.print(); 52 testp = argp; 53 argp.print(); 54 testp.print(); 55 ; 56} 57 58int main() 59{ 60 person mainp; 61 test(mainp); 62 if (pass) 63 printf ("PASS\n"); 64 else 65 { printf ("FAIL\n"); return 1; } 66} 67 68