<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60861>60861</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            16.0.0~rc1: `move_only_function` with `noexcept` signature from libstdc++ fails to compile
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          mkoncek
      </td>
    </tr>
</table>

<pre>
    ```
$ clang++ --version
clang version 16.0.0 (Fedora 16.0.0~rc1-3.fc37)
Target: x86_64-redhat-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```

Compiling the following code:
```
#include <functional>

int main()
{
        auto f = std::move_only_function<void() noexcept>([]() noexcept -> void {});
}
```
produces an error:
```
$ clang++ -std=c++2b test.cpp 
In file included from test.cpp:1:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/functional:71:
In file included from /usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/move_only_function.h:189:
/usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/mofunc_impl.h:109:16: error: assigning to '_Invoker' (aka 'void (*)(_Mofunc_base *) noexcept(true)') from incompatible type '<overloaded function type>'
 _M_invoke = &_S_invoke<_Vt>;
 ^~~~~~~~~~~~~~~
test.cpp:5:11: note: in instantiation of function template specialization 'std::move_only_function<void () noexcept>::move_only_function<(lambda at test.cpp:5:52), (lambda at test.cpp:5:52)>' requested here
        auto f = std::move_only_function<void() noexcept>([]() noexcept -> void {});
 ^
/usr/bin/../lib/gcc/x86_64-redhat-linux/12/../../../../include/c++/12/bits/mofunc_impl.h:215:2: note: candidate function template has different exception specification
 _S_invoke(_Mofunc_base _GLIBCXX_MOF_CV* __self,
        ^
1 error generated.
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMVk2P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