<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Using std::__throw_bad_weak_ptr can produce invalid RTTI for std::runtime_error"
   href="https://bugs.llvm.org/show_bug.cgi?id=37487">37487</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Using std::__throw_bad_weak_ptr can produce invalid RTTI for std::runtime_error
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Macintosh
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>MacOS X
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>C++
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>davidcapello@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>dgregor@apple.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>If we compile a .cpp file with -frtti which throws std::runtime_error and
catches std::exception&, but then we compile another file with -fno-rtti that
uses std::__throw_bad_weak_ptr() in some way and we link both files in one
binary, the final std::runtime_error class is not identified as a derived class
of std::exception (so the catch code is not executed).

Here is a minimal example of this case:
<a href="https://gist.github.com/dacap/7ddffbe401eb42620de397e47edfcc76">https://gist.github.com/dacap/7ddffbe401eb42620de397e47edfcc76</a>

clang --version
Apple LLVM version 9.1.0 (clang-902.0.39.1)
Target: x86_64-apple-darwin17.5.0
Thread model: posix
InstalledDir:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>