<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 - Destructor of std::any should not propagate exceptions"
   href="https://bugs.llvm.org/show_bug.cgi?id=51758">51758</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Destructor of std::any should not propagate exceptions
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>12.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>All Bugs
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>johelegp@gmail.com, llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>See <a href="https://godbolt.org/z/Yrszd3d4f">https://godbolt.org/z/Yrszd3d4f</a>, and
<a href="https://github.com/cplusplus/draft/issues/4863#issuecomment-913215699">https://github.com/cplusplus/draft/issues/4863#issuecomment-913215699</a>. The
destructor fails to meet the requirements of
<a href="https://eel.is/c++draft/res.on.exception.handling#3">https://eel.is/c++draft/res.on.exception.handling#3</a>:
<span class="quote">> Destructor operations defined in the C++ standard library shall not throw exceptions. Every destructor in the C++ standard library shall behave as if it had a non-throwing exception specification.</span >
```C++
#include <any>
struct X { ~X() noexcept(false) { throw 0; } };
int main()
try {
  std::any x{X{}};
}
catch(int) {
  throw 0ull; // Terminate on thrown int means throw within noexcept
}
```
```
Program returned: 139
libc++abi: terminating with uncaught exception of type unsigned long long
```</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>