fork download
  1. #include <memory>
  2.  
  3. struct A {};
  4.  
  5. struct B : A {};
  6.  
  7. int main()
  8. {
  9. auto x = std::make_shared<A>();
  10. if (auto p = dynamic_pointer_cast<B>(x));
  11. }
  12.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp: In function 'int main()':
prog.cpp:10:15: error: 'dynamic_pointer_cast' was not declared in this scope
prog.cpp:10:37: error: expected primary-expression before '>' token
prog.cpp:10:40: error: unable to deduce 'auto' from '<expression error>'
stdout

Standard output is empty