[libcxx-commits] [PATCH] D113436: [libc++] [test] Eliminate libcpp-no-noexcept-function-type and libcpp-no-structured-bindings
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Nov 8 14:04:51 PST 2021
Quuxplusone created this revision.
Quuxplusone added reviewers: ldionne, Mordante, libc++.
Quuxplusone added a project: libc++.
Herald added a subscriber: arichardson.
Quuxplusone requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++.
(Following up from D113348 <https://reviews.llvm.org/D113348>.)
At this point, every supported compiler that claims a -std=c++17 mode should also support these features.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D113436
Files:
libcxx/test/std/utilities/meta/meta.rel/is_nothrow_invocable.pass.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
libcxx/utils/libcxx/test/features.py
Index: libcxx/utils/libcxx/test/features.py
===================================================================
--- libcxx/utils/libcxx/test/features.py
+++ libcxx/utils/libcxx/test/features.py
@@ -36,12 +36,10 @@
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='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, """
Index: libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
===================================================================
--- libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
+++ libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_structured_bindings.pass.cpp
@@ -15,7 +15,6 @@
// : public integral_constant<size_t, sizeof...(Types)> { };
// UNSUPPORTED: c++03, c++11, c++14
-// UNSUPPORTED: libcpp-no-structured-bindings
#include <tuple>
#include <array>
Index: libcxx/test/std/utilities/meta/meta.rel/is_nothrow_invocable.pass.cpp
===================================================================
--- libcxx/test/std/utilities/meta/meta.rel/is_nothrow_invocable.pass.cpp
+++ libcxx/test/std/utilities/meta/meta.rel/is_nothrow_invocable.pass.cpp
@@ -54,30 +54,16 @@
!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**) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113436.385630.patch
Type: text/x-patch
Size: 3742 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211108/49ba058d/attachment.bin>
More information about the libcxx-commits
mailing list