struct Base { virtual void foo () {} }; void foo (Base *p) { class Derived *pD = dynamic_cast<Derived*>(p); } int main () { } struct Derived : Base { };
Standard input is empty
prog.cpp: In function ‘void foo(Base*)’: prog.cpp:7: error: cannot dynamic_cast ‘p’ (of type ‘struct Base*’) to type ‘struct Derived*’ (target is not pointer or reference to complete type) prog.cpp:7: warning: unused variable ‘pD’
Standard output is empty