fork(2) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. class Test {
  5. public:
  6. void foo();
  7. };
  8.  
  9. struct Bar : public Test
  10. {
  11. void foo() override;
  12. };
  13.  
  14. void Bar::foo()
  15. {
  16. cout << "Test!";
  17. }
  18.  
  19. int main() {
  20. Bar b;
  21. b.foo();
  22. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:11:7: error: 'void Bar::foo()' marked 'override', but does not override
  void foo() override;
       ^
stdout
Standard output is empty