noreturn attribute across function call wrapper

53 Views Asked by At

Is it possible to make noreturn work together with a function call wrapper, like std::invoke:

#include <functional>

[[noreturn]] void foo()
    {std::terminate();}

int doStuff()
   {std::invoke(foo);}

This results in a warning, but doStuff will not return.

0

There are 0 best solutions below