1 // PR tree-optimization/47420 2 // Testcase by Yu Simin <silver24k@gmail.com> 3 4 // { dg-do compile } 5 // { dg-options "-O2" } 6 7 class fooControlBase 8 { 9 public: fooControlBase()10 fooControlBase() { } 11 12 virtual ~fooControlBase(); 13 }; 14 15 class fooControl : public fooControlBase 16 { 17 public: fooControl()18 fooControl() { } 19 }; 20 21 class sfTextEntryBase 22 { 23 public: sfTextEntryBase()24 sfTextEntryBase() { } 25 virtual ~sfTextEntryBase(); 26 }; 27 28 class sfTextEntry : public sfTextEntryBase 29 { 30 public: sfTextEntry()31 sfTextEntry() 32 { 33 } 34 }; 35 36 class sfTextAreaBase 37 { 38 public: sfTextAreaBase()39 sfTextAreaBase() { } ~sfTextAreaBase()40 virtual ~sfTextAreaBase() { } 41 42 protected: 43 }; 44 45 46 class sfTextCtrlBase : public fooControl, 47 public sfTextAreaBase, 48 public sfTextEntry 49 { 50 public: 51 52 53 sfTextCtrlBase()54 sfTextCtrlBase() { } ~sfTextCtrlBase()55 virtual ~sfTextCtrlBase() { } 56 }; 57 58 class sfTextCtrl : public sfTextCtrlBase 59 { 60 public: sfTextCtrl(void * parent)61 sfTextCtrl(void* parent) 62 { 63 Create(parent); 64 } 65 virtual ~sfTextCtrl(); 66 67 bool Create(void *parent); 68 69 70 }; 71 CreateTextCtrl()72sfTextCtrl* CreateTextCtrl() 73 { 74 return new sfTextCtrl(0); 75 } 76 foo()77void foo () 78 { 79 new sfTextCtrl(0); 80 } 81