<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </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 --- - condition_variable::wait could throw an exception despite being noexcept"
   href="https://llvm.org/bugs/show_bug.cgi?id=24436">24436</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>condition_variable::wait could throw an exception despite being noexcept
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.7
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

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

        <tr>
          <th>Severity</th>
          <td>normal
          </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>manuel.freiberger@gmx.at
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Hello,

Reading through the code, I have seen that condition_variable::wait() in
condition_variable.cpp:39 does potentially throw a system_error although
the function has a noexcept specification. Throwing an exception and 
marking the function noexcept at the same time seems inconsistent to me.

Having a glance at the C++ standard, I do not see a noexcept specifier
for condition_variable::wait(). So one solution would be to remove
the noexcept from the source code. 

If this is not desired, I think it would be more consistent to replace the 
exceptions by assertions similar to what recursive_mutex::unlock() does.
The exception cannot reach the user anyway as std::terminate() whould
be called before.

The function condition_variable::__do_timed_wait() suffers from the same
problem.

Best regards,
Manuel</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>