#include <iostream> struct Base {}; struct Derived : public Base {}; int main() { Derived ** d = nullptr; Base ** b = static_cast<Base **>(d); return 0; }
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:9:36: error: invalid static_cast from type ‘Derived**’ to type ‘Base**’ Base ** b = static_cast<Base **>(d); ^ prog.cpp:9:10: warning: unused variable ‘b’ [-Wunused-variable] Base ** b = static_cast<Base **>(d); ^
Standard output is empty