!std::is_nothrow_invocable_r<Ret, Fn, Args...>::value;
}
-// FIXME(EricWF) Don't test the where noexcept is *not* part of the type system
-// once implementations have caught up.
void test_noexcept_function_pointers() {
struct Dummy {
void foo() noexcept {}
static void bar() noexcept {}
};
-#if !defined(__cpp_noexcept_function_type)
- {
- // Check that PMF's and function pointers *work*. is_nothrow_invocable will always
- // return false because 'noexcept' is not part of the function type.
- static_assert(throws_invocable<decltype(&Dummy::foo), Dummy&>(), "");
- static_assert(throws_invocable<decltype(&Dummy::bar)>(), "");
- }
-#else
- {
- // Check that PMF's and function pointers actually work and that
- // is_nothrow_invocable returns true for noexcept PMF's and function
- // pointers.
- static_assert(
- std::is_nothrow_invocable<decltype(&Dummy::foo), Dummy&>::value, "");
- static_assert(std::is_nothrow_invocable<decltype(&Dummy::bar)>::value, "");
- }
-#endif
+ // Check that PMF's and function pointers actually work and that
+ // is_nothrow_invocable returns true for noexcept PMF's and function
+ // pointers.
+ static_assert(std::is_nothrow_invocable<decltype(&Dummy::foo), Dummy&>::value, "");
+ static_assert(std::is_nothrow_invocable<decltype(&Dummy::bar)>::value, "");
}
int main(int, char**) {
// : public integral_constant<size_t, sizeof...(Types)> { };
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-structured-bindings
#include <tuple>
#include <array>
Feature(name='-fsized-deallocation', when=lambda cfg: hasCompileFlag(cfg, '-fsized-deallocation')),
Feature(name='-faligned-allocation', when=lambda cfg: hasCompileFlag(cfg, '-faligned-allocation')),
Feature(name='fdelayed-template-parsing', when=lambda cfg: hasCompileFlag(cfg, '-fdelayed-template-parsing')),
- Feature(name='libcpp-no-structured-bindings', when=lambda cfg: '__cpp_structured_bindings' not in featureTestMacros(cfg)),
Feature(name='libcpp-no-concepts', when=lambda cfg: featureTestMacros(cfg).get('__cpp_concepts', 0) < 201907),
Feature(name='libcpp-no-coroutines', when=lambda cfg: featureTestMacros(cfg).get('__cpp_impl_coroutine', 0) < 201902),
Feature(name='has-fobjc-arc', when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc') and
sys.platform.lower().strip() == 'darwin'), # TODO: this doesn't handle cross-compiling to Apple platforms.
Feature(name='objective-c++', when=lambda cfg: hasCompileFlag(cfg, '-xobjective-c++ -fobjc-arc')),
- Feature(name='no-noexcept-function-type', when=lambda cfg: featureTestMacros(cfg).get('__cpp_noexcept_function_type', 0) < 201510),
Feature(name='non-lockfree-atomics',
when=lambda cfg: sourceBuilds(cfg, """
//===----------------------------------------------------------------------===//
// Can a noexcept function pointer be caught by a non-noexcept catch clause?
-// UNSUPPORTED: no-exceptions, no-noexcept-function-type
+// UNSUPPORTED: c++03, c++11, c++14
+// UNSUPPORTED: no-exceptions
// Support for catching a function pointer including noexcept was shipped in macOS 10.13
// XFAIL: use_system_cxx_lib && {{.+}}-apple-macosx10.{{9|10|11|12}}
//===----------------------------------------------------------------------===//
// Can a noexcept member function pointer be caught by a non-noexcept catch clause?
-// UNSUPPORTED: no-exceptions, no-noexcept-function-type
+// UNSUPPORTED: c++03, c++11, c++14
+// UNSUPPORTED: no-exceptions
// Support for catching a function pointer including noexcept was shipped in macOS 10.13
// XFAIL: use_system_cxx_lib && {{.+}}-apple-macosx10.{{9|10|11|12}}