title: What does it mean when a dynamic_cast fails?
body: <p>I've encountered a few cases in KDE software where a dynamic_cast of something that's a KPart fails on OS X. I'm not that much of a C++ expert, so I wouldn't even know where to begin to debug such a situation.
  I've seen this happen with ktimetracker, and the latest (and better discussed) case is with Okular: <a href="https://bugs.kde.org/show_bug.cgi?id=345765" rel="nofollow">https://bugs.kde.org/show_bug.cgi?id=345765</a></p>
  
  <p>In a nutshell: the <code>Okular::Part</code> class inherits the <code>Okular::ViewInterface</code> class (as the last parent in a list). Yet when the code retrieves an <code>Okular::Part*</code> instance (<code>part</code>), <code>dynamic_cast&lt;Okular::ViewInterface*&gt;(part)</code> returns NULL.</p>
  
  <p>The last comment in the BKO ticket above is that using a static cast would be a poor man's fix in this case, but that I should try to figure out why the dynamic_cast fails. Which leads me to 2 questions:</p>
  
  <ul>
  <li>what does a dynamic_cast do in addition to a traditional cast here?</li>
  <li>how would I figure out why it fails? This would be an issue with the runtime, libc++, no?</li>
  </ul>