prog.cpp:7:8: error: ISO C++ forbids declaration of ‘incr’ with no type [-fpermissive]
incr() { count++; }
^
prog.cpp: In constructor ‘Child1::Child1()’:
prog.cpp:21:22: error: ‘Countable Child1::cnt’ is a static data member; it can only be initialized at its definition
Child1(): Parent(), cnt() { incr(); }
^~~
prog.cpp:21:35: error: ‘incr’ was not declared in this scope
Child1(): Parent(), cnt() { incr(); }
^
prog.cpp: At global scope:
prog.cpp:25:13: error: ISO C++ does not permit ‘Parent::count’ to be defined as ‘Child1::count’ [-fpermissive]
int Child1::count = 0;
^~~~~
prog.cpp:25:13: error: redefinition of ‘int Parent::count’
prog.cpp:18:5: note: ‘int Parent::count’ previously defined here
int Parent::count = 0;
^~~~~~