<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 - std::invoke fails to call noexcept marked function"
   href="https://bugs.llvm.org/show_bug.cgi?id=37407">37407</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>std::invoke fails to call noexcept marked function
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>blitzrakete@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>std::invoke wrongly takes the partial specialization for objects instead for
functions for functions marked with noexcept. I'm on r331914.

#include <functional>

void func() noexcept {}

int main() { std::invoke(func); }

Here's the full error message:

In file included from main.cpp:1:
In file included from /usr/local/bin/../include/c++/v1/functional:484:
/usr/local/bin/../include/c++/v1/type_traits:4196:19: error: invalid
application of 'sizeof' to a function type
    static_assert(sizeof(_Tp) > 0, Type must be complete.);
                  ^~~~~~~~~~~
/usr/local/bin/../include/c++/v1/type_traits:4201:15: note: in instantiation of
template class 'std::__1::__check_complete<void () noexcept>' requested here
    : private __check_complete<_Tp>
              ^
/usr/local/bin/../include/c++/v1/type_traits:4494:15: note: in instantiation of
template class 'std::__1::__check_complete<void (&)() noexcept>' requested here
    : private __check_complete<_Fp>
              ^
/usr/local/bin/../include/c++/v1/type_traits:4557:9: note: in instantiation of
template class 'std::__1::__invokable_r<void, void (&)() noexcept>' requested
here
        __invokable<_Fp, _Args...>::value,
        ^
/usr/local/bin/../include/c++/v1/type_traits:4566:14: note: in instantiation of
template class 'std::__1::__invoke_of<void (&)() noexcept>' requested here
    : public __invoke_of<_Fp, _Args...>
             ^
/usr/local/bin/../include/c++/v1/type_traits:4571:22: note: in instantiation of
template class 'std::__1::result_of<void (&())() noexcept>' requested here
template <class _Tp> using result_of_t = typename result_of<_Tp>::type;
                     ^
/usr/local/bin/../include/c++/v1/functional:2346:1: note: in instantiation of
template type alias 'result_of_t' requested here
result_of_t<_Fn&&(_Args&&...)>
^
main.cpp:5:14: note: while substituting deduced template arguments into
function template 'invoke' [with _Fn = void (&)() noexcept, _Args = <>]
int main() { std::invoke(func); }
             ^
1 error generated.</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>