#include <iostream> using namespace std; class Base { virtual void f() = 0; }; class A: Base { }; int main() { A a; return 0; }
Standard input is empty
prog.cpp: In function 'int main()': prog.cpp:15:4: error: cannot declare variable 'a' to be of abstract type 'A' A a; ^ prog.cpp:9:7: note: because the following virtual functions are pure within 'A': class A: Base ^ prog.cpp:6:17: note: virtual void Base::f() virtual void f() = 0; ^
Standard output is empty