diff options
author | Asiri Rathnayake <asiri.rathnayake@arm.com> | 2016-05-28 08:57:35 +0000 |
---|---|---|
committer | Asiri Rathnayake <asiri.rathnayake@arm.com> | 2016-05-28 08:57:35 +0000 |
commit | 6edc12c8867fe8d21f9abf97b160d12dc2fa3954 (patch) | |
tree | b05c2b476059d6ecf37ebee52db35c369cd0a74d /libcxx/test/std/experimental/optional | |
parent | 6abd38bf6efc809654fcdf6c98d4378fcc4a040b (diff) | |
download | bcm5719-llvm-6edc12c8867fe8d21f9abf97b160d12dc2fa3954.tar.gz bcm5719-llvm-6edc12c8867fe8d21f9abf97b160d12dc2fa3954.zip |
[libcxx] Improve tests to use the UNSUPPORTED lit directive
Quite a few libcxx tests seem to follow the format:
#if _LIBCPP_STD_VER > X
// Do test.
#else
// Empty test.
#endif
We should instead use the UNSUPPORTED lit directive to exclude the test on
earlier C++ standards. This gives us a more accurate number of test passes
for those standards and avoids unnecessary conflicts with other lit
directives on the same tests.
Reviewers: bcraig, ericwf, mclow.lists
Differential revision: http://reviews.llvm.org/D20730
llvm-svn: 271108
Diffstat (limited to 'libcxx/test/std/experimental/optional')
60 files changed, 62 insertions, 318 deletions
diff --git a/libcxx/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp b/libcxx/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp index cecf98a3518..c166bb72a83 100644 --- a/libcxx/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.bad_optional_access/default.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 + // <optional> // class bad_optional_access is default constructible @@ -16,8 +18,6 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::bad_optional_access; bad_optional_access ex; -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp b/libcxx/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp index c13d6603990..253905681d1 100644 --- a/libcxx/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.bad_optional_access/derive.pass.cpp @@ -7,6 +7,8 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 + // <optional> // class bad_optional_access : public logic_error @@ -16,10 +18,8 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::bad_optional_access; static_assert(std::is_base_of<std::logic_error, bad_optional_access>::value, ""); static_assert(std::is_convertible<bad_optional_access*, std::logic_error*>::value, ""); -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.comp_with_t/equal.pass.cpp b/libcxx/test/std/experimental/optional/optional.comp_with_t/equal.pass.cpp index e796723cc09..b3cfc7d7858 100644 --- a/libcxx/test/std/experimental/optional/optional.comp_with_t/equal.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.comp_with_t/equal.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator==(const optional<T>& x, const T& v); @@ -14,8 +15,6 @@ #include <experimental/optional> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -28,11 +27,8 @@ struct X constexpr bool operator == ( const X &lhs, const X &rhs ) { return lhs.i_ == rhs.i_ ; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 { typedef X T; typedef optional<T> O; @@ -54,5 +50,4 @@ int main() static_assert ( (T(2) == o3), "" ); static_assert ( (val == o3), "" ); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.comp_with_t/greater.pass.cpp b/libcxx/test/std/experimental/optional/optional.comp_with_t/greater.pass.cpp index cf3923bb4fb..5a3b534f137 100644 --- a/libcxx/test/std/experimental/optional/optional.comp_with_t/greater.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.comp_with_t/greater.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator>(const optional<T>& x, const T& v); @@ -14,8 +15,6 @@ #include <experimental/optional> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -28,12 +27,8 @@ struct X constexpr bool operator < ( const X &lhs, const X &rhs ) { return lhs.i_ < rhs.i_ ; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 - { typedef X T; typedef optional<T> O; @@ -57,5 +52,4 @@ int main() static_assert ( !(val > o3), "" ); // equal static_assert ( (T(3) > o3), "" ); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.comp_with_t/greater_equal.pass.cpp b/libcxx/test/std/experimental/optional/optional.comp_with_t/greater_equal.pass.cpp index 85fea1377b3..8d4a4c4132e 100644 --- a/libcxx/test/std/experimental/optional/optional.comp_with_t/greater_equal.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.comp_with_t/greater_equal.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator>=(const optional<T>& x, const T& v); @@ -14,8 +15,6 @@ #include <experimental/optional> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -28,12 +27,8 @@ struct X constexpr bool operator < ( const X &lhs, const X &rhs ) { return lhs.i_ < rhs.i_ ; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 - { typedef X T; typedef optional<T> O; @@ -57,5 +52,4 @@ int main() static_assert ( (val >= o3), "" ); // equal static_assert ( (T(3) >= o3), "" ); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.comp_with_t/less_equal.pass.cpp b/libcxx/test/std/experimental/optional/optional.comp_with_t/less_equal.pass.cpp index 333f7cdea21..42452f158ae 100644 --- a/libcxx/test/std/experimental/optional/optional.comp_with_t/less_equal.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.comp_with_t/less_equal.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator<=(const optional<T>& x, const T& v); @@ -14,8 +15,6 @@ #include <experimental/optional> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -28,12 +27,8 @@ struct X constexpr bool operator < ( const X &lhs, const X &rhs ) { return lhs.i_ < rhs.i_ ; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 - { typedef X T; typedef optional<T> O; @@ -57,5 +52,4 @@ int main() static_assert ( (val <= o3), "" ); // equal static_assert ( !(T(3) <= o3), "" ); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.comp_with_t/less_than.pass.cpp b/libcxx/test/std/experimental/optional/optional.comp_with_t/less_than.pass.cpp index e35df21bbab..1ff9221b4f7 100644 --- a/libcxx/test/std/experimental/optional/optional.comp_with_t/less_than.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.comp_with_t/less_than.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator<(const optional<T>& x, const T& v); @@ -14,8 +15,6 @@ #include <experimental/optional> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -28,12 +27,8 @@ struct X constexpr bool operator < ( const X &lhs, const X &rhs ) { return lhs.i_ < rhs.i_ ; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 - { typedef X T; typedef optional<T> O; @@ -57,5 +52,4 @@ int main() static_assert ( !(val < o3), "" ); // equal static_assert ( !(T(3) < o3), "" ); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.comp_with_t/not_equal.pass.cpp b/libcxx/test/std/experimental/optional/optional.comp_with_t/not_equal.pass.cpp index 0dad68d3863..7e14e6e0b03 100644 --- a/libcxx/test/std/experimental/optional/optional.comp_with_t/not_equal.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.comp_with_t/not_equal.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator!=(const optional<T>& x, const T& v); @@ -14,8 +15,6 @@ #include <experimental/optional> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -28,11 +27,8 @@ struct X constexpr bool operator == ( const X &lhs, const X &rhs ) { return lhs.i_ == rhs.i_ ; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 { typedef X T; typedef optional<T> O; @@ -54,5 +50,4 @@ int main() static_assert ( !(T(2) != o3), "" ); static_assert ( !(val != o3), "" ); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.hash/hash.pass.cpp b/libcxx/test/std/experimental/optional/optional.hash/hash.pass.cpp index 9e5fb55c833..21126740bf8 100644 --- a/libcxx/test/std/experimental/optional/optional.hash/hash.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.hash/hash.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> struct hash<optional<T>>; @@ -19,7 +20,6 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; { @@ -43,5 +43,4 @@ int main() opt = std::unique_ptr<int>(new int(3)); assert(std::hash<optional<T>>{}(opt) == std::hash<T>{}(*opt)); } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.inplace/in_place_t.pass.cpp b/libcxx/test/std/experimental/optional/optional.inplace/in_place_t.pass.cpp index 360b9d91671..9d7e98969dc 100644 --- a/libcxx/test/std/experimental/optional/optional.inplace/in_place_t.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.inplace/in_place_t.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // struct in_place_t{}; @@ -15,8 +16,6 @@ #include <experimental/optional> #include <type_traits> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; using std::experimental::in_place_t; using std::experimental::in_place; @@ -28,15 +27,10 @@ test(const in_place_t&) return 3; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 - static_assert((std::is_class<in_place_t>::value), ""); static_assert((std::is_empty<in_place_t>::value), ""); static_assert(test(in_place) == 3, ""); -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.nullops/equal.pass.cpp b/libcxx/test/std/experimental/optional/optional.nullops/equal.pass.cpp index 931db614425..7b42847bc3f 100644 --- a/libcxx/test/std/experimental/optional/optional.nullops/equal.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.nullops/equal.pass.cpp @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// - +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator==(const optional<T>& x, nullopt_t) noexcept; @@ -17,7 +17,6 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; using std::experimental::nullopt_t; using std::experimental::nullopt; @@ -37,5 +36,4 @@ int main() static_assert (noexcept(nullopt == o1), ""); static_assert (noexcept(o1 == nullopt), ""); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.nullops/greater.pass.cpp b/libcxx/test/std/experimental/optional/optional.nullops/greater.pass.cpp index b72a4d3f1a6..f26e8f874db 100644 --- a/libcxx/test/std/experimental/optional/optional.nullops/greater.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.nullops/greater.pass.cpp @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// - +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator>(const optional<T>& x, nullopt_t) noexcept; @@ -17,7 +17,6 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; using std::experimental::nullopt_t; using std::experimental::nullopt; @@ -37,5 +36,4 @@ int main() static_assert (noexcept(nullopt > o1), ""); static_assert (noexcept(o1 > nullopt), ""); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.nullops/greater_equal.pass.cpp b/libcxx/test/std/experimental/optional/optional.nullops/greater_equal.pass.cpp index 86c8743b555..3d22ea0d269 100644 --- a/libcxx/test/std/experimental/optional/optional.nullops/greater_equal.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.nullops/greater_equal.pass.cpp @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// - +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator>=(const optional<T>& x, nullopt_t) noexcept; @@ -17,7 +17,6 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; using std::experimental::nullopt_t; using std::experimental::nullopt; @@ -37,5 +36,4 @@ int main() static_assert (noexcept(nullopt >= o1), ""); static_assert (noexcept(o1 >= nullopt), ""); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.nullops/less_than.pass.cpp b/libcxx/test/std/experimental/optional/optional.nullops/less_than.pass.cpp index 149c809b040..d2fa726e283 100644 --- a/libcxx/test/std/experimental/optional/optional.nullops/less_than.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.nullops/less_than.pass.cpp @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// - +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator<(const optional<T>& x, nullopt_t) noexcept; @@ -17,7 +17,6 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; using std::experimental::nullopt_t; using std::experimental::nullopt; @@ -37,5 +36,4 @@ int main() static_assert (noexcept(nullopt < o1), ""); static_assert (noexcept(o1 < nullopt), ""); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.nullops/not_equal.pass.cpp b/libcxx/test/std/experimental/optional/optional.nullops/not_equal.pass.cpp index 6f28edf6d26..b693a640972 100644 --- a/libcxx/test/std/experimental/optional/optional.nullops/not_equal.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.nullops/not_equal.pass.cpp @@ -7,7 +7,7 @@ // //===----------------------------------------------------------------------===// - +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator!=(const optional<T>& x, nullopt_t) noexcept; @@ -17,7 +17,6 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; using std::experimental::nullopt_t; using std::experimental::nullopt; @@ -37,5 +36,4 @@ int main() static_assert (noexcept(nullopt != o1), ""); static_assert (noexcept(o1 != nullopt), ""); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.nullopt/nullopt_t.pass.cpp b/libcxx/test/std/experimental/optional/optional.nullopt/nullopt_t.pass.cpp index de1e83b653c..5e629d72682 100644 --- a/libcxx/test/std/experimental/optional/optional.nullopt/nullopt_t.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.nullopt/nullopt_t.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // struct nullopt_t{see below}; @@ -15,8 +16,6 @@ #include <experimental/optional> #include <type_traits> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; using std::experimental::nullopt_t; using std::experimental::nullopt; @@ -28,16 +27,12 @@ test(const nullopt_t&) return 3; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 static_assert((std::is_class<nullopt_t>::value), ""); static_assert((std::is_empty<nullopt_t>::value), ""); static_assert((std::is_literal_type<nullopt_t>::value), ""); static_assert((!std::is_default_constructible<nullopt_t>::value), ""); static_assert(test(nullopt) == 3, ""); -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp index e256a098f1a..3d0d2e03158 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/assign_value.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class U> optional<T>& operator=(U&& v); @@ -16,19 +17,14 @@ #include <cassert> #include <memory> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X { }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 static_assert(std::is_assignable<optional<int>, int>::value, ""); static_assert(std::is_assignable<optional<int>, int&>::value, ""); static_assert(std::is_assignable<optional<int>&, int>::value, ""); @@ -68,5 +64,4 @@ int main() assert(static_cast<bool>(opt) == true); assert(**opt == 3); } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp index 999d03d3a88..89ea345029c 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/copy.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // XFAIL: libcpp-no-exceptions // <optional> @@ -16,8 +17,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -34,11 +33,8 @@ struct X bool X::throw_now = false; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { optional<int> opt; constexpr optional<int> opt2; @@ -87,5 +83,4 @@ int main() assert(static_cast<bool>(opt) == false); } } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp index ec98ef44915..94f2bb21a47 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // XFAIL: libcpp-no-exceptions // <optional> @@ -17,8 +18,6 @@ #include <cassert> #include <memory> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; class X @@ -55,11 +54,8 @@ public: bool Z::dtor_called = false; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { optional<int> opt; opt.emplace(); @@ -145,5 +141,4 @@ int main() assert(Z::dtor_called == true); } } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp index aada0f4ec53..bb8fcd5a7ce 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // XFAIL: libcpp-no-exceptions // <optional> @@ -18,8 +19,6 @@ #include <cassert> #include <vector> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; class X @@ -70,11 +69,8 @@ public: bool Z::dtor_called = false; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { X x; { @@ -113,5 +109,4 @@ int main() assert(Z::dtor_called == true); } } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp index 3e084e5b7dc..fa00f5602c7 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/move.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // XFAIL: libcpp-no-exceptions // <optional> @@ -18,8 +19,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -42,11 +41,8 @@ struct Y {}; bool X::throw_now = false; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { static_assert(std::is_nothrow_move_assignable<optional<int>>::value, ""); optional<int> opt; @@ -100,5 +96,4 @@ int main() { static_assert(std::is_nothrow_move_assignable<optional<Y>>::value, ""); } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp index 7f39744f055..b1d851b32f4 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // optional<T>& operator=(nullopt_t) noexcept; @@ -15,8 +16,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; using std::experimental::nullopt_t; using std::experimental::nullopt; @@ -29,11 +28,8 @@ struct X bool X::dtor_called = false; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { optional<int> opt; static_assert(noexcept(opt = nullopt) == true, ""); @@ -63,5 +59,4 @@ int main() assert(static_cast<bool>(opt) == false); } } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp index 7d401de1d97..144af2e3a7d 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/copy.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // XFAIL: libcpp-no-exceptions // <optional> @@ -16,8 +17,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; template <class T> @@ -76,11 +75,8 @@ public: }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { typedef int T; optional<T> rhs; @@ -121,5 +117,4 @@ int main() optional<T> rhs(Z(3)); test(rhs, true); } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/default.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/default.pass.cpp index 6a1763de22b..d24a1ac69b8 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/default.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/default.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // constexpr optional() noexcept; @@ -15,8 +16,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; template <class Opt> @@ -55,13 +54,9 @@ struct X X(); }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 test_constexpr<optional<int>>(); test_constexpr<optional<int*>>(); test<optional<X>>(); -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp index 7a98e0bf31f..1ad6bad2e04 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/initializer_list.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // XFAIL: libcpp-no-exceptions // <optional> @@ -19,8 +20,6 @@ #include <vector> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; using std::experimental::in_place_t; using std::experimental::in_place; @@ -67,12 +66,8 @@ public: {return x.i_ == y.i_ && x.j_ == y.j_;} }; - -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { static_assert(!std::is_constructible<X, std::initializer_list<int>&>::value, ""); static_assert(!std::is_constructible<optional<X>, std::initializer_list<int>&>::value, ""); @@ -123,5 +118,4 @@ int main() }; } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp index 40d55f91899..851157f960f 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/move.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // XFAIL: libcpp-no-exceptions // <optional> @@ -16,8 +17,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; template <class T> @@ -75,12 +74,8 @@ public: friend constexpr bool operator==(const Z& x, const Z& y) {return x.i_ == y.i_;} }; - -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { typedef int T; optional<T> rhs; @@ -121,5 +116,4 @@ int main() optional<T> rhs(Z(3)); test(rhs, true); } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp index c307a2e1e25..40c96581ed8 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.ctor/nullopt_t.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // constexpr optional(nullopt_t) noexcept; @@ -15,8 +16,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; using std::experimental::nullopt_t; using std::experimental::nullopt; @@ -56,13 +55,9 @@ struct X X(); }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 test_constexpr<optional<int>>(); test_constexpr<optional<int*>>(); test<optional<X>>(); -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.dtor/dtor.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.dtor/dtor.pass.cpp index 2697799f0e5..2bec19e6b4f 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.dtor/dtor.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.dtor/dtor.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // ~optional(); @@ -15,8 +16,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; class X @@ -29,11 +28,8 @@ public: bool X::dtor_called = false; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { typedef int T; static_assert(std::is_trivially_destructible<T>::value, ""); @@ -55,5 +51,4 @@ int main() } assert(X::dtor_called == true); } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/bool.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/bool.pass.cpp index a3724375cf4..a5bfae24007 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/bool.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/bool.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // constexpr explicit optional<T>::operator bool() const noexcept; @@ -17,7 +18,6 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; { @@ -28,5 +28,4 @@ int main() constexpr optional<int> opt(0); static_assert(opt, ""); } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/dereference.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/dereference.pass.cpp index 98e5dac9719..faba8d25606 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/dereference.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/dereference.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // T& optional<T>::operator*(); @@ -19,8 +20,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -29,11 +28,8 @@ struct X int test() {return 4;} }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { optional<X> opt(X{}); assert((*opt).test() == 4); @@ -45,5 +41,4 @@ int main() assert(false); } #endif // _LIBCPP_DEBUG -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/dereference_const.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/dereference_const.pass.cpp index c72a57852a3..f1bdc36424d 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/dereference_const.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/dereference_const.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // constexpr const T& optional<T>::operator*() const; @@ -19,8 +20,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -33,11 +32,8 @@ struct Y int test() const {return 2;} }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { constexpr optional<X> opt(X{}); static_assert((*opt).test() == 3, ""); @@ -53,5 +49,4 @@ int main() assert(false); } #endif // _LIBCPP_DEBUG -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp index b17fcf8d305..954ccd71ff5 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // constexpr T* optional<T>::operator->(); @@ -19,8 +20,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -28,11 +27,8 @@ struct X constexpr int test() const {return 3;} }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { constexpr optional<X> opt(X{}); static_assert(opt->test() == 3, ""); @@ -44,5 +40,4 @@ int main() assert(false); } #endif // _LIBCPP_DEBUG -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp index e813dd992a5..cf900d7029e 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/op_arrow_const.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // constexpr const T* optional<T>::operator->() const; @@ -19,8 +20,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -39,11 +38,8 @@ struct Z constexpr int test() const {return 1;} }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { constexpr optional<X> opt(X{}); static_assert(opt->test() == 3, ""); @@ -63,5 +59,4 @@ int main() assert(false); } #endif // _LIBCPP_DEBUG -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp index 85f9be6998a..b998f3067f4 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // XFAIL: libcpp-no-exceptions // <optional> @@ -16,8 +17,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; using std::experimental::bad_optional_access; @@ -29,11 +28,8 @@ struct X int test() {return 4;} }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { optional<X> opt; opt.emplace(); @@ -50,5 +46,4 @@ int main() { } } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_const.fail.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_const.fail.cpp index f0f8af6da45..baad3b47f3e 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_const.fail.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_const.fail.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // constexpr const T& optional<T>::value() const; @@ -15,8 +16,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -25,16 +24,10 @@ struct X int test() {return 4;} }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { constexpr optional<X> opt; static_assert(opt.value().test() == 3, ""); } -#else -#error -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp index c99baab8b6e..a38b1f930c7 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_const.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // XFAIL: libcpp-no-exceptions // <optional> @@ -16,8 +17,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; using std::experimental::in_place_t; using std::experimental::in_place; @@ -31,11 +30,8 @@ struct X int test() {return 4;} }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { constexpr optional<X> opt(in_place); static_assert(opt.value().test() == 3, ""); @@ -55,5 +51,4 @@ int main() { } } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_or.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_or.pass.cpp index 6118c44bb5b..6fca8c82ceb 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_or.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_or.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class U> T optional<T>::value_or(U&& v) &&; @@ -15,8 +16,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; using std::experimental::in_place_t; using std::experimental::in_place; @@ -40,11 +39,8 @@ struct X {return x.i_ == y.i_;} }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { optional<X> opt(in_place, 2); Y y(3); @@ -67,5 +63,4 @@ int main() assert(std::move(opt).value_or(Y(3)) == 4); assert(!opt); } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_or_const.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_or_const.pass.cpp index d51f18abbd2..4a008dce238 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_or_const.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.observe/value_or_const.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class U> constexpr T optional<T>::value_or(U&& v) const&; @@ -15,8 +16,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct Y @@ -37,11 +36,8 @@ struct X {return x.i_ == y.i_;} }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { constexpr optional<X> opt(2); constexpr Y y(3); @@ -78,5 +74,4 @@ int main() const optional<X> opt; assert(opt.value_or(Y(3)) == 4); } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp index d24a2d06b9d..620dda19e3f 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional.object.swap/swap.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // XFAIL: libcpp-no-exceptions // <optional> @@ -18,8 +19,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; class X @@ -63,12 +62,8 @@ public: friend void swap(Z& x, Z& y) {throw 6;} }; - -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { optional<int> opt1; optional<int> opt2; @@ -303,5 +298,4 @@ int main() assert(static_cast<bool>(opt2) == true); assert(*opt2 == 2); } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional_const_void.fail.cpp b/libcxx/test/std/experimental/optional/optional.object/optional_const_void.fail.cpp index 6999cf2451f..02c0a3a63a5 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional_const_void.fail.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional_const_void.fail.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // T shall be an object type and shall satisfy the requirements of Destructible @@ -15,11 +16,7 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; optional<const void> opt; -#else -#error -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional_not_destructible.fail.cpp b/libcxx/test/std/experimental/optional/optional.object/optional_not_destructible.fail.cpp index 61470af0119..da8bd05f2c9 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional_not_destructible.fail.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional_not_destructible.fail.cpp @@ -7,14 +7,13 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // T shall be an object type and shall satisfy the requirements of Destructible #include <experimental/optional> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -23,13 +22,7 @@ private: ~X() {} }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 optional<X> opt; -#else -#error -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional_not_noexcept_destructible.fail.cpp b/libcxx/test/std/experimental/optional/optional.object/optional_not_noexcept_destructible.fail.cpp index eaee02014c2..7aa179afeaf 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional_not_noexcept_destructible.fail.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional_not_noexcept_destructible.fail.cpp @@ -7,14 +7,13 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // T shall be an object type and shall satisfy the requirements of Destructible #include <experimental/optional> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -22,13 +21,7 @@ struct X ~X() noexcept(false) {} }; -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 optional<X> opt; -#else -#error -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/optional_void.fail.cpp b/libcxx/test/std/experimental/optional/optional.object/optional_void.fail.cpp index f911e9a2d6d..73f689c5672 100644 --- a/libcxx/test/std/experimental/optional/optional.object/optional_void.fail.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/optional_void.fail.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // T shall be an object type and shall satisfy the requirements of Destructible @@ -15,11 +16,7 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; optional<void> opt; -#else -#error -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.object/types.pass.cpp b/libcxx/test/std/experimental/optional/optional.object/types.pass.cpp index 8b9ad2e1957..af8da2df8fd 100644 --- a/libcxx/test/std/experimental/optional/optional.object/types.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.object/types.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> @@ -19,8 +20,6 @@ #include <experimental/optional> #include <type_traits> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; template <class Opt, class T> @@ -30,14 +29,10 @@ test() static_assert(std::is_same<typename Opt::value_type, T>::value, ""); } -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 test<optional<int>, int>(); test<optional<const int>, const int>(); test<optional<double>, double>(); test<optional<const double>, const double>(); -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.relops/equal.pass.cpp b/libcxx/test/std/experimental/optional/optional.relops/equal.pass.cpp index 03b9d3fda5c..230ce44d9ae 100644 --- a/libcxx/test/std/experimental/optional/optional.relops/equal.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.relops/equal.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator==(const optional<T>& x, const optional<T>& y); @@ -15,8 +16,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -29,11 +28,8 @@ struct X constexpr bool operator == ( const X &lhs, const X &rhs ) { return lhs.i_ == rhs.i_ ; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 { typedef X T; typedef optional<T> O; @@ -75,5 +71,4 @@ int main() static_assert ( o5 == o5 , "" ); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.relops/greater_equal.pass.cpp b/libcxx/test/std/experimental/optional/optional.relops/greater_equal.pass.cpp index 98d6855f931..49afd2adda0 100644 --- a/libcxx/test/std/experimental/optional/optional.relops/greater_equal.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.relops/greater_equal.pass.cpp @@ -7,14 +7,13 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator>= (const optional<T>& x, const optional<T>& y); #include <experimental/optional> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -27,11 +26,8 @@ struct X constexpr bool operator < ( const X &lhs, const X &rhs ) { return lhs.i_ < rhs.i_ ; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 { typedef optional<X> O; @@ -71,5 +67,4 @@ int main() static_assert ( !(o5 >= o4), "" ); static_assert ( (o5 >= o5), "" ); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.relops/greater_than.pass.cpp b/libcxx/test/std/experimental/optional/optional.relops/greater_than.pass.cpp index d51bd4f2ac4..6b6dd164c51 100644 --- a/libcxx/test/std/experimental/optional/optional.relops/greater_than.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.relops/greater_than.pass.cpp @@ -7,14 +7,13 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator> (const optional<T>& x, const optional<T>& y); #include <experimental/optional> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -27,11 +26,8 @@ struct X constexpr bool operator < ( const X &lhs, const X &rhs ) { return lhs.i_ < rhs.i_ ; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 { typedef optional<X> O; @@ -71,5 +67,4 @@ int main() static_assert ( !(o5 > o4), "" ); static_assert ( !(o5 > o5), "" ); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.relops/less_equal.pass.cpp b/libcxx/test/std/experimental/optional/optional.relops/less_equal.pass.cpp index 326f3a89649..904dedf2d04 100644 --- a/libcxx/test/std/experimental/optional/optional.relops/less_equal.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.relops/less_equal.pass.cpp @@ -7,14 +7,13 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator<= (const optional<T>& x, const optional<T>& y); #include <experimental/optional> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -27,11 +26,8 @@ struct X constexpr bool operator < ( const X &lhs, const X &rhs ) { return lhs.i_ < rhs.i_ ; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 { typedef optional<X> O; @@ -71,5 +67,4 @@ int main() static_assert ( (o5 <= o4), "" ); static_assert ( (o5 <= o5), "" ); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.relops/less_than.pass.cpp b/libcxx/test/std/experimental/optional/optional.relops/less_than.pass.cpp index 37f7e194298..9affee180d0 100644 --- a/libcxx/test/std/experimental/optional/optional.relops/less_than.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.relops/less_than.pass.cpp @@ -7,14 +7,13 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator< (const optional<T>& x, const optional<T>& y); #include <experimental/optional> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -27,11 +26,8 @@ struct X constexpr bool operator < ( const X &lhs, const X &rhs ) { return lhs.i_ < rhs.i_ ; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 { typedef optional<X> O; @@ -71,5 +67,4 @@ int main() static_assert ( (o5 < o4), "" ); static_assert ( !(o5 < o5), "" ); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.relops/not_equal.pass.cpp b/libcxx/test/std/experimental/optional/optional.relops/not_equal.pass.cpp index f386c7e361e..864c8080ef0 100644 --- a/libcxx/test/std/experimental/optional/optional.relops/not_equal.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.relops/not_equal.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> constexpr bool operator!=(const optional<T>& x, const optional<T>& y); @@ -15,8 +16,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; struct X @@ -29,11 +28,8 @@ struct X constexpr bool operator == ( const X &lhs, const X &rhs ) { return lhs.i_ == rhs.i_ ; } -#endif - int main() { -#if _LIBCPP_STD_VER > 11 { typedef X T; typedef optional<T> O; @@ -75,5 +71,4 @@ int main() static_assert ( !(o5 != o5), "" ); } -#endif } diff --git a/libcxx/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp b/libcxx/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp index cc95e6110e8..7f5ffea6fa7 100644 --- a/libcxx/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.specalg/make_optional.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // template <class T> @@ -21,7 +22,6 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; using std::experimental::make_optional; @@ -46,5 +46,4 @@ int main() assert(**opt == 3); assert(s == nullptr); } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.specalg/swap.pass.cpp b/libcxx/test/std/experimental/optional/optional.specalg/swap.pass.cpp index 6c5f7b0e860..d339c53c1f7 100644 --- a/libcxx/test/std/experimental/optional/optional.specalg/swap.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.specalg/swap.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // XFAIL: libcpp-no-exceptions // <optional> @@ -17,8 +18,6 @@ #include <type_traits> #include <cassert> -#if _LIBCPP_STD_VER > 11 - using std::experimental::optional; class X @@ -62,12 +61,8 @@ public: friend void swap(Z& x, Z& y) {throw 6;} }; - -#endif // _LIBCPP_STD_VER > 11 - int main() { -#if _LIBCPP_STD_VER > 11 { optional<int> opt1; optional<int> opt2; @@ -302,5 +297,4 @@ int main() assert(static_cast<bool>(opt2) == true); assert(*opt2 == 2); } -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.syn/optional_const_in_place_t.fail.cpp b/libcxx/test/std/experimental/optional/optional.syn/optional_const_in_place_t.fail.cpp index 60836ae2396..bdf01eba406 100644 --- a/libcxx/test/std/experimental/optional/optional.syn/optional_const_in_place_t.fail.cpp +++ b/libcxx/test/std/experimental/optional/optional.syn/optional_const_in_place_t.fail.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // A program that necessitates the instantiation of template optional for @@ -16,13 +17,9 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; using std::experimental::in_place_t; using std::experimental::in_place; optional<const in_place_t> opt; -#else -#error -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.syn/optional_const_lvalue_ref.fail.cpp b/libcxx/test/std/experimental/optional/optional.syn/optional_const_lvalue_ref.fail.cpp index 9a4ba1a027a..61393c105e9 100644 --- a/libcxx/test/std/experimental/optional/optional.syn/optional_const_lvalue_ref.fail.cpp +++ b/libcxx/test/std/experimental/optional/optional.syn/optional_const_lvalue_ref.fail.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // A program that necessitates the instantiation of template optional for a @@ -16,11 +17,7 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; optional<const int&> opt; -#else -#error -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp b/libcxx/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp index f6220bda69c..fb695d29820 100644 --- a/libcxx/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp +++ b/libcxx/test/std/experimental/optional/optional.syn/optional_const_nullopt_t.fail.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // A program that necessitates the instantiation of template optional for @@ -16,13 +17,9 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; using std::experimental::nullopt_t; using std::experimental::nullopt; optional<const nullopt_t> opt; -#else -#error -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.syn/optional_in_place_t.fail.cpp b/libcxx/test/std/experimental/optional/optional.syn/optional_in_place_t.fail.cpp index 12f291fcd22..47c2be7da0d 100644 --- a/libcxx/test/std/experimental/optional/optional.syn/optional_in_place_t.fail.cpp +++ b/libcxx/test/std/experimental/optional/optional.syn/optional_in_place_t.fail.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // A program that necessitates the instantiation of template optional for @@ -16,13 +17,9 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; using std::experimental::in_place_t; using std::experimental::in_place; optional<in_place_t> opt; -#else -#error -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp b/libcxx/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp index 7e6697ff6e5..8cf11b553e7 100644 --- a/libcxx/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp +++ b/libcxx/test/std/experimental/optional/optional.syn/optional_includes_initializer_list.pass.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // #include <initializer_list> @@ -15,9 +16,7 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; std::initializer_list<int> list; -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.syn/optional_lvalue_ref.fail.cpp b/libcxx/test/std/experimental/optional/optional.syn/optional_lvalue_ref.fail.cpp index 850df342aef..de2f18991b2 100644 --- a/libcxx/test/std/experimental/optional/optional.syn/optional_lvalue_ref.fail.cpp +++ b/libcxx/test/std/experimental/optional/optional.syn/optional_lvalue_ref.fail.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // A program that necessitates the instantiation of template optional for a @@ -16,11 +17,7 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; optional<int&> opt; -#else -#error -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp b/libcxx/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp index 20955ace834..9b62c9b3994 100644 --- a/libcxx/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp +++ b/libcxx/test/std/experimental/optional/optional.syn/optional_nullopt_t.fail.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // A program that necessitates the instantiation of template optional for @@ -16,13 +17,9 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; using std::experimental::nullopt_t; using std::experimental::nullopt; optional<nullopt_t> opt; -#else -#error -#endif // _LIBCPP_STD_VER > 11 } diff --git a/libcxx/test/std/experimental/optional/optional.syn/optional_rvalue_ref.fail.cpp b/libcxx/test/std/experimental/optional/optional.syn/optional_rvalue_ref.fail.cpp index d773e993df2..fd6da18e8c1 100644 --- a/libcxx/test/std/experimental/optional/optional.syn/optional_rvalue_ref.fail.cpp +++ b/libcxx/test/std/experimental/optional/optional.syn/optional_rvalue_ref.fail.cpp @@ -7,6 +7,7 @@ // //===----------------------------------------------------------------------===// +// UNSUPPORTED: c++98, c++03, c++11 // <optional> // A program that necessitates the instantiation of template optional for a @@ -16,11 +17,7 @@ int main() { -#if _LIBCPP_STD_VER > 11 using std::experimental::optional; optional<int&&> opt; -#else -#error -#endif // _LIBCPP_STD_VER > 11 } |