fork download
  1. struct element {};
  2.  
  3. struct table_procedure : element {};
  4.  
  5.  
  6. int main() {
  7. element * const i = new table_procedure;
  8. dynamic_cast<table_procedure *>(i);
  9. }
Compilation error #stdin compilation error #stdout 0s 3468KB
stdin
Standard input is empty
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:8:37: error: cannot dynamic_cast ‘i’ (of type ‘struct element* const’) to type ‘struct table_procedure*’ (source type is not polymorphic)
    dynamic_cast<table_procedure *>(i);
                                     ^
stdout
Standard output is empty