fork download
  1. #include <iostream>
  2.  
  3. struct A
  4. {
  5. virtual ~A() final = default;
  6. };
  7.  
  8. struct B : A
  9. {
  10. };
  11.  
  12. int main()
  13. {
  14. (B());
  15. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:8:8: error: virtual function ‘virtual B::~B()’
 struct B : A
        ^
prog.cpp:5:10: error: overriding final function ‘virtual A::~A()’
  virtual ~A() final = default;
          ^
stdout

Standard output is empty