Advertisement
agul

Caide bug with removing used methods

Jul 12th, 2015
647
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.72 KB | None | 0 0
  1. /* Solution file */
  2.  
  3. class Test {
  4. public:
  5.     Test(int n) : n(n) {}
  6.     ~Test() {
  7.         print();
  8.     }
  9.     void print() {
  10.         cout << n << endl;
  11.     }
  12. private:
  13.     int n;
  14. };
  15.  
  16. void solve(istream& in, ostream& out) {
  17.     Test a(1000);
  18. }
  19.  
  20. /* Submission.cpp: no method "Test::print()" that is called from destructor (destructor is not called explicitly, only by default on exit from function solve() )  */
  21.  
  22. class Test {
  23. public:
  24.     Test(int n) : n(n) {}
  25.     ~Test() {
  26.         print();
  27.     }
  28. private:
  29.     int n;
  30. };
  31.  
  32. void solve(istream& in, ostream& out) {
  33.     Test a(1000);
  34. }
  35.  
  36.  
  37.  
  38. /* **************************** */
  39.  
  40.  
  41. /* Solution file */
  42.  
  43. class Test {
  44. public:
  45.     Test(int n) : n(n) {}
  46.     ~Test() {
  47.         print();
  48.     }
  49.     void print() {
  50.         cout << n << endl;
  51.     }
  52. private:
  53.     int n;
  54. };
  55.  
  56. void solve(istream& in, ostream& out) {
  57.     Test * a = new Test(1000);
  58.     delete a;
  59. }
  60.  
  61. /* Submission.cpp: no method "Test::print()" that is called from destructor (destructor is called implicitly by operator delete ) */
  62.  
  63. class Test {
  64. public:
  65.     Test(int n) : n(n) {}
  66.     ~Test() {
  67.         print();
  68.     }
  69. private:
  70.     int n;
  71. };
  72.  
  73. void solve(istream& in, ostream& out) {
  74.     Test * a = new Test(1000);
  75.     delete a;
  76. }
  77.  
  78.  
  79.  
  80. /* **************************** */
  81.  
  82.  
  83. /* Solution file */
  84.  
  85. class Test {
  86. public:
  87.     Test(int n) : n(n) {}
  88.     ~Test() {
  89.         print();
  90.     }
  91.     void print() {
  92.         cout << n << endl;
  93.     }
  94. private:
  95.     int n;
  96. };
  97.  
  98. void solve(istream& in, ostream& out) {
  99.     Test a(1000);
  100.     a.~Test();
  101. }
  102.  
  103. /* Submission.cpp: works fine (destructor is called explicitly by a.~Test() ) */
  104.  
  105. class Test {
  106. public:
  107.     Test(int n) : n(n) {}
  108.     ~Test() {
  109.         print();
  110.     }
  111.     void print() {
  112.         cout << n << endl;
  113.     }
  114. private:
  115.     int n;
  116. };
  117.  
  118. void solve(istream& in, ostream& out) {
  119.     Test a(1000);
  120.     a.~Test();
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement