[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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@271108 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Asiri Rathnayake
2016-05-28 08:57:35 +00:00
parent dcb35ad8ae
commit a3eac518e6
126 changed files with 176 additions and 581 deletions

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// dynarray.cons
// template <class Alloc>
@@ -23,8 +24,6 @@
#include <__config>
#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include <cassert>
@@ -81,6 +80,4 @@ int main()
// test ( nstr("fourteen"), Alloc(3), Alloc(4) );
// test ( { nstr("1"), nstr("1"), nstr("2"), nstr("3"), nstr("5"), nstr("8")}, Alloc(6));
}
#else
int main() {}
#endif

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// dynarray.data
// void fill(const T& v);
@@ -15,8 +16,6 @@
#include <__config>
#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include <cassert>
@@ -43,6 +42,4 @@ int main()
test<std::complex<double>> ( std::complex<double> ( 14, 0 ));
test<std::string> ( "fourteen" );
}
#else
int main() {}
#endif

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// XFAIL: libcpp-no-exceptions
// dynarray.overview
@@ -15,8 +16,6 @@
#include <__config>
#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include <cassert>
@@ -90,6 +89,4 @@ int main()
test<std::complex<double>> ( {} );
test<std::string> ( {} );
}
#else
int main() {}
#endif

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// dynarray.overview
@@ -27,8 +28,6 @@
#include <__config>
#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include <cassert>
@@ -103,6 +102,4 @@ int main()
test<std::complex<double>> ( std::complex<double> ( 14, 0 ));
test<std::string> ( "fourteen" );
}
#else
int main() {}
#endif

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// dynarray.overview
// size_type size() const noexcept;
@@ -15,8 +16,6 @@
#include <__config>
#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include <cassert>
@@ -52,6 +51,4 @@ int main()
test<std::complex<double>> ( {} );
test<std::string> ( {} );
}
#else
int main() {}
#endif

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// dynarray.overview
// const_reference at(size_type n) const;
@@ -14,8 +15,6 @@
#include <__config>
#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include <cassert>
@@ -66,6 +65,4 @@ int main()
test<std::complex<double>> ( {} );
test<std::string> ( {} );
}
#else
int main() {}
#endif

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// dynarray.data
// template <class Type, class Alloc>
@@ -15,8 +16,6 @@
#include <__config>
#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include "test_allocator.h"
@@ -26,6 +25,4 @@ int main()
{
static_assert ( std::uses_allocator<dynarray<int>, test_allocator<int>>::value, "" );
}
#else
int main() {}
#endif

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// dynarray.zero
// dynarray shall provide support for the special case of construction with a size of zero.
@@ -18,8 +19,6 @@
#include <__config>
#if _LIBCPP_STD_VER > 11
#include <experimental/dynarray>
#include <cassert>
@@ -45,6 +44,4 @@ int main()
test<std::complex<double>> ();
test<std::string> ();
}
#else
int main() {}
#endif

View File

@@ -7,16 +7,15 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <experimental/ratio>
// Test that <ratio> is included.
#include <experimental/ratio>
#if _LIBCPP_STD_VER > 11
# ifndef _LIBCPP_RATIO
#ifndef _LIBCPP_RATIO
# error " <experimental/ratio> must include <ratio>"
# endif
#endif
int main()

View File

@@ -7,14 +7,13 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <experimental/system_error>
#include <experimental/system_error>
#if _LIBCPP_STD_VER > 11
# ifndef _LIBCPP_SYSTEM_ERROR
#ifndef _LIBCPP_SYSTEM_ERROR
# error "<experimental/system_error> must include <system_error>"
# endif
#endif
int main()

View File

@@ -7,14 +7,13 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <experimental/chrono>
#include <experimental/chrono>
#if _LIBCPP_STD_VER > 11
# ifndef _LIBCPP_CHRONO
#ifndef _LIBCPP_CHRONO
# error "<experimental/chrono> must include <chrono>"
# endif
#endif
int main()

View File

@@ -7,15 +7,14 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <experimental/tuple>
#include <experimental/tuple>
int main()
{
#if _LIBCPP_STD_VER > 11
# ifndef _LIBCPP_TUPLE
#ifndef _LIBCPP_TUPLE
# error "<experimental/tuple> must include <tuple>"
# endif
#endif /* _LIBCPP_STD_VER > 11 */
#endif
}

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <list>
// Operations on "NULL" iterators
@@ -25,7 +26,6 @@ struct S { int val; };
int main()
{
#if _LIBCPP_STD_VER > 11
{
unsigned lib_asserts;
@@ -55,7 +55,6 @@ int main()
try { (void) ci->val; } catch (int) { ++lib_asserts; }
assert(lib_asserts == 4);
}
#endif
}
#else

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <vector>
// vector<bool>
@@ -18,7 +19,6 @@
int main()
{
#if _LIBCPP_STD_VER > 11
{
typedef std::vector<bool> C;
C c;
@@ -64,5 +64,4 @@ int main()
assert(c[1] == true);
assert(c.back() == true);
}
#endif
}

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <vector>
// vector.bool
@@ -19,7 +20,6 @@
int main()
{
#if _LIBCPP_STD_VER > 11
{
typedef std::vector<bool> C;
C c;
@@ -53,5 +53,4 @@ int main()
assert(c[1] == true);
assert(c.back() == true);
}
#endif
}

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <system_error>
// class error_category
@@ -18,8 +19,6 @@
#include <string>
#include <cassert>
#if _LIBCPP_STD_VER > 11
class test1
: public std::error_category
{
@@ -29,12 +28,8 @@ public:
virtual std::string message(int) const {return std::string();}
};
#endif // _LIBCPP_STD_VER > 11
int main()
{
#if _LIBCPP_STD_VER > 11
static_assert(std::is_nothrow_default_constructible<test1>::value,
"error_category() must exist and be noexcept");
#endif // _LIBCPP_STD_VER > 11
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <string>
// template<class charT, class traits, class Allocator>
@@ -17,8 +18,6 @@
#include <experimental/string_view>
#include <cassert>
#if _LIBCPP_STD_VER > 11
template <class S>
void
test(const std::string &lhs, S rhs, bool x)
@@ -49,6 +48,4 @@ int main()
test("abcdefghijklmnopqrst", S("abcdefghijklmnopqrst"), true);
}
}
#else
int main () {}
#endif

View File

@@ -7,14 +7,13 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <experimental/type_traits>
#include <experimental/type_traits>
#if _LIBCPP_STD_VER > 11
# ifndef _LIBCPP_TYPE_TRAITS
#ifndef _LIBCPP_TYPE_TRAITS
# error "<experimental/type_traits> must include <type_traits>"
# endif
#endif
int main()

View File

@@ -7,12 +7,11 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <experimental/type_traits>
#include <experimental/type_traits>
#if _LIBCPP_STD_VER > 11
namespace ex = std::experimental;
struct base_type {};
@@ -60,6 +59,4 @@ int main()
static_assert(ex::is_convertible_v<T, U> == std::is_convertible<T, U>::value, "");
}
}
#else /* _LIBCPP_STD_VER <= 11 */
int main() {}
#endif /* _LIBCPP_STD_VER > 11 */

View File

@@ -7,12 +7,11 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <experimental/type_traits>
#include <experimental/type_traits>
#if _LIBCPP_STD_VER > 11
namespace ex = std::experimental;
struct class_type {};
@@ -176,6 +175,4 @@ int main()
static_assert(ex::is_function_v<T> == std::is_function<T>::value, "");
}
}
#else /* _LIBCPP_STD_VER <= 11 */
int main() {}
#endif /* _LIBCPP_STD_VER > 11 */

View File

@@ -7,12 +7,11 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <experimental/type_traits>
#include <experimental/type_traits>
#if _LIBCPP_STD_VER > 11
namespace ex = std::experimental;
struct class_type {};
@@ -97,6 +96,4 @@ int main()
static_assert(ex::is_member_pointer_v<T> == std::is_member_pointer<T>::value, "");
}
}
#else /* _LIBCPP_STD_VER <= 11 */
int main() {}
#endif /* _LIBCPP_STD_VER > 11 */

View File

@@ -7,12 +7,11 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <experimental/type_traits>
#include <experimental/type_traits>
#if _LIBCPP_STD_VER > 11
namespace ex = std::experimental;
struct non_literal_type { non_literal_type() {} };
@@ -484,6 +483,4 @@ int main()
static_assert(ex::has_virtual_destructor_v<T> == std::has_virtual_destructor<T>::value, "");
}
}
#else /* _LIBCPP_STD_VER <= 11 */
int main() {}
#endif /* _LIBCPP_STD_VER > 11 */

View File

@@ -7,12 +7,11 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <experimental/type_traits>
#include <experimental/type_traits>
#if _LIBCPP_STD_VER > 11
namespace ex = std::experimental;
int main()
@@ -61,6 +60,3 @@ int main()
static_assert(ex::extent_v<T, 0> == std::extent<T, 0>::value, "");
}
}
#else /* _LIBCPP_STD_VER <= 11 */
int main() {}
#endif /* _LIBCPP_STD_VER > 11 */

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// test <cstdio>
// gets
@@ -15,9 +16,5 @@
int main()
{
#if _LIBCPP_STD_VER > 11
(void) std::gets((char *) NULL);
#else
#error
#endif
}

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <iterator>
// reverse_iterator
@@ -19,8 +20,6 @@
#include "test_iterators.h"
#if _LIBCPP_STD_VER > 11
template <class It>
void
test(It i)
@@ -37,6 +36,4 @@ int main()
while ( b != e )
test ( b++ );
}
#else
int main () {}
#endif

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// test bad_array_length
#include <new>
@@ -15,7 +16,6 @@
int main()
{
#if __LIBCPP_STD_VER > 11
static_assert((std::is_base_of<std::bad_alloc, std::bad_array_length>::value),
"std::is_base_of<std::bad_alloc, std::bad_array_length>::value");
static_assert(std::is_polymorphic<std::bad_array_length>::value,
@@ -25,5 +25,4 @@ int main()
b2 = b;
const char* w = b2.what();
assert(w);
#endif
}

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <chrono>
#include <complex>
@@ -15,7 +16,6 @@
int main()
{
#if _LIBCPP_STD_VER > 11
using namespace std::literals::complex_literals;
// Make sure the types are right
@@ -46,6 +46,4 @@ int main()
auto c2 = 3if;
assert ( c1 == c2 );
}
#endif
}

View File

@@ -7,14 +7,12 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
#include <complex>
#include <cassert>
int main()
{
#if _LIBCPP_STD_VER > 11
std::complex<float> foo = 1.0if; // should fail w/conversion operator not found
#else
#error
#endif
}

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <chrono>
#include <complex>
@@ -15,7 +16,6 @@
int main()
{
#if _LIBCPP_STD_VER > 11
using namespace std::literals;
{
@@ -38,6 +38,4 @@ int main()
auto c2 = 3if;
assert ( c1 == c2 );
}
#endif
}

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <chrono>
#include <complex>
@@ -15,7 +16,6 @@
int main()
{
#if _LIBCPP_STD_VER > 11
using namespace std;
{
@@ -38,6 +38,4 @@ int main()
auto c2 = 3if;
assert ( c1 == c2 );
}
#endif
}

View File

@@ -7,12 +7,14 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
#include <string>
#include <cassert>
int main()
{
#if _LIBCPP_STD_VER > 11
using namespace std::literals::string_literals;
static_assert ( std::is_same<decltype( "Hi"s), std::string>::value, "" );
@@ -43,5 +45,4 @@ int main()
Lfoo = L"ABC"s; assert(Lfoo == L"ABC"); assert(Lfoo == std::wstring ( L"ABC"));
ufoo = u"ABC"s; assert(ufoo == u"ABC"); assert(ufoo == std::u16string( u"ABC"));
Ufoo = U"ABC"s; assert(Ufoo == U"ABC"); assert(Ufoo == std::u32string( U"ABC"));
#endif
}

View File

@@ -7,16 +7,15 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
#include <string>
#include <cassert>
int main()
{
#if _LIBCPP_STD_VER > 11
using std::string;
string foo = ""s; // should fail w/conversion operator not found
#else
#error
#endif
}

View File

@@ -7,14 +7,15 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
#include <string>
#include <cassert>
int main()
{
#if _LIBCPP_STD_VER > 11
using namespace std::literals;
std::string foo = ""s;
#endif
}

View File

@@ -7,14 +7,13 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
#include <string>
#include <cassert>
int main()
{
#if _LIBCPP_STD_VER > 11
std::string foo = ""s; // should fail w/conversion operator not found
#else
#error
#endif
}

View File

@@ -7,14 +7,15 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
#include <string>
#include <cassert>
int main()
{
#if _LIBCPP_STD_VER > 11
using namespace std::literals::string_literals;
std::string foo = ""s;
#endif
}

View File

@@ -7,14 +7,15 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
#include <string>
#include <cassert>
int main()
{
#if _LIBCPP_STD_VER > 11
using namespace std;
string foo = ""s;
#endif
}

View File

@@ -7,6 +7,8 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <string>
// iterator begin();
@@ -21,7 +23,6 @@
int main()
{
#if _LIBCPP_STD_VER > 11
{ // N3644 testing
typedef std::string C;
C::iterator ii1{}, ii2{};
@@ -69,5 +70,4 @@ int main()
assert ( !(ii1 != ii2 ));
assert ( !(ii1 != cii ));
}
#endif
}

View File

@@ -7,8 +7,7 @@
//
//===----------------------------------------------------------------------===//
//
// XFAIL: libcpp-no-exceptions
// UNSUPPORTED: libcpp-has-no-threads
// UNSUPPORTED: libcpp-has-no-threads, libcpp-no-exceptions
// <future>

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
// template <class Mutex> class shared_lock;
@@ -15,20 +16,12 @@
#include <shared_mutex>
#if _LIBCPP_STD_VER > 11
std::shared_timed_mutex m0;
std::shared_timed_mutex m1;
#endif // _LIBCPP_STD_VER > 11
int main()
{
#if _LIBCPP_STD_VER > 11
std::shared_lock<std::shared_timed_mutex> lk0(m0);
std::shared_lock<std::shared_timed_mutex> lk1(m1);
lk1 = lk0;
#else
# error
#endif // _LIBCPP_STD_VER > 11
}

View File

@@ -7,6 +7,7 @@
//
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++98, c++03, c++11
// <shared_mutex>
// template <class Mutex> class shared_lock;
@@ -15,16 +16,10 @@
#include <shared_mutex>
#if _LIBCPP_STD_VER > 11
std::shared_timed_mutex m;
#endif // _LIBCPP_STD_VER > 11
int main()
{
#if _LIBCPP_STD_VER > 11
std::shared_lock<std::shared_timed_mutex> lk0(m);
std::shared_lock<std::shared_timed_mutex> lk = lk0;
#else
# error
#endif // _LIBCPP_STD_VER > 11
}

Some files were not shown because too many files have changed in this diff Show More