1 // { dg-do run } 2 3 class EtherCtrl { 4 protected: 5 int ssap; 6 7 public: 8 EtherCtrl(void); 9 ~EtherCtrl(); 10 virtual int getSsap(void) const; 11 virtual void setSsap(int); 12 }; 13 14 class EtherFrameWithLLC { 15 protected: 16 int ssap; 17 18 public: 19 EtherFrameWithLLC(const char *, int); 20 ~EtherFrameWithLLC(); 21 virtual int getSsap(void) const; 22 virtual void setSsap(int); 23 }; 24 25 EtherCtrl()26EtherCtrl::EtherCtrl() 27 { 28 this->ssap = 0; 29 } 30 ~EtherCtrl()31EtherCtrl::~EtherCtrl() 32 { 33 } 34 getSsap() const35int EtherCtrl::getSsap() const 36 { 37 return ssap; 38 } 39 setSsap(int ssap)40void EtherCtrl::setSsap(int ssap) 41 { 42 this->ssap = ssap; 43 } 44 EtherFrameWithLLC(const char * name,int kind)45EtherFrameWithLLC::EtherFrameWithLLC(const char *name, int kind) 46 { 47 this->ssap = 0; 48 } 49 ~EtherFrameWithLLC()50EtherFrameWithLLC::~EtherFrameWithLLC() 51 { 52 } 53 getSsap() const54int EtherFrameWithLLC::getSsap() const 55 { 56 return ssap; 57 } 58 setSsap(int ssap)59void EtherFrameWithLLC::setSsap(int ssap) 60 { 61 this->ssap = ssap; 62 } 63 64 65 int main(int argc,char ** argv)66main (int argc, char **argv) 67 { 68 EtherCtrl *etherctrl = new EtherCtrl (); 69 EtherFrameWithLLC *frame = new EtherFrameWithLLC ("test", 10); 70 int my_value; 71 72 etherctrl->setSsap(43); 73 frame->setSsap(etherctrl->getSsap()); 74 my_value = frame->getSsap(); 75 76 return 0; 77 } 78