<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 - clang incorrectly requires coroutine_handle::from_address to be noexcept"
   href="https://bugs.llvm.org/show_bug.cgi?id=49109">49109</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>clang incorrectly requires coroutine_handle::from_address to be noexcept
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Windows NT
          </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++2a
          </td>
        </tr>

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

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

        <tr>
          <th>CC</th>
          <td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>from_address() is not required to be noexcept:
<a href="https://eel.is/c++draft/coroutine.handle">https://eel.is/c++draft/coroutine.handle</a>

However clang will error with a line pointing to (the end of)
coroutine_handle<_Promise>::from_address(), presumably because it is checking
for noexcept as per <a href="https://eel.is/c++draft/dcl.fct.def.coroutine#15">https://eel.is/c++draft/dcl.fct.def.coroutine#15</a> after
generating that call as part of its internal lowering. This feels like a
leaking of an implementation detail. In practice, it causes issues when trying
to use libstdc++'s <coroutine> because it doesn't mark that method as noexcept.
I've filed a bug (<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99021">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99021</a>) with them
asking to change it, but it would be nice if clang didn't require the noexcept,
both because it isn't required by the standard, and because it will make it
easier to use clang with the already-in-the-wild libstdc++-10 installs.

src/mongo/db/index/columns_index_access_method.cpp:328:28: error: the
expression 'co_await __promise.final_suspend()' is required to be non-throwing
    generator<BSONElement> subcellElements() const {
                           ^
/bin/../lib64/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../include/c++/10.2.0/coroutine:205:5:
note: must be declared with 'noexcept'
    }</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>