#include <iostream> using namespace std; class B; void asd(B&) {} struct A { virtual void a() {asd(*this);} }; struct B: public A {}; int main() { // your code goes here return 0; }
Standard input is empty
prog.cpp: In member function 'virtual void A::a()': prog.cpp:8:29: error: invalid initialization of reference of type 'B&' from expression of type 'A' virtual void a() {asd(*this);} ^ prog.cpp:4:6: note: in passing argument 1 of 'void asd(B&)' void asd(B&) {} ^
Standard output is empty