prog.cpp:12:7: error: redefinition of ‘class P2’
class P2 : public P2 {
^~
prog.cpp:3:7: error: previous definition of ‘class P2’
class P2 {
^~
prog.cpp:12:1: error: new types may not be defined in a return type
class P2 : public P2 {
^~~~~
prog.cpp:12:1: note: (perhaps a semicolon is missing after the definition of ‘<type error>’)
prog.cpp:15:10: error: two or more data types in declaration of ‘main’
int main() {
^