https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87538
Bug ID: 87538 Summary: Incorrect noexcept specifier for not_fn Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: barry.revzin at gmail dot com Target Milestone: --- Found by Edgar RokjÄn (https://stackoverflow.com/q/52673235/2069064). The noexcept specifier for _Not_fn currently only checks the noexcept-ness of applying the ! operator on the return type, not of the actual call: noexcept(noexcept(_S_not<__inv_res_t<_Fn _QUALS, _Args...>>())) As a result, this fails: #include <functional> struct X { int operator()(int); }; static_assert(!noexcept( std::not_fn(X{})(2))); While not_fn isn't actually specified to have any kind of noexcept-specifier, this one seems actively wrong - either it should propagate through the type's actual call function (so the above assert shouldn't trigger) or it should never be noexcept (likewise).