[libc++] Fix warnings with Clang in C++03

This commit is contained in:
Louis Dionne 2020-04-21 11:02:29 -04:00
parent cd8e9e8fcd
commit b4fb705e77
31 changed files with 87 additions and 2 deletions

View File

@ -12,6 +12,9 @@
// function& operator=(function &&);
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -12,6 +12,9 @@
// function& operator=(nullptr_t);
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -13,6 +13,8 @@
// template <MoveConstructible R, MoveConstructible ... ArgTypes>
// void swap(function<R(ArgTypes...)>&, function<R(ArgTypes...)>&) noexcept;
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cstdlib>

View File

@ -12,6 +12,9 @@
// explicit operator bool() const
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -12,6 +12,9 @@
// function(F);
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -15,6 +15,9 @@
// && Convertible<Callable<F, ArgTypes...>::result_type
// operator=(F f);
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -14,6 +14,9 @@
// Allow incomplete argument types in the __is_callable check
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -15,6 +15,9 @@
// Ensure that __not_null works for all function types.
// See https://bugs.llvm.org/show_bug.cgi?id=23589
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
//------------------------------------------------------------------------------
// TESTING std::function<...>::__not_null(Callable)
//

View File

@ -13,6 +13,9 @@
// template<class A> function(allocator_arg_t, const A&);
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -15,6 +15,9 @@
//
// This signature was removed in C++17
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -15,6 +15,9 @@
//
// This signature was removed in C++17
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -13,6 +13,9 @@
// template<class F, class A> function(allocator_arg_t, const A&, F);
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -15,6 +15,8 @@
//
// This signature was removed in C++17
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -13,6 +13,8 @@
// template<class A> function(allocator_arg_t, const A&, const function&);
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -15,6 +15,9 @@
//
// This signature was removed in C++17
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -15,6 +15,9 @@
//
// This signature was removed in C++17
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -15,6 +15,9 @@
//
// This signature was removed in C++17
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <memory>
#include <cassert>

View File

@ -12,6 +12,9 @@
// function& operator=(const function& f);
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -13,6 +13,9 @@
// function(const function& f);
// function(function&& f); // noexcept in C++20
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <memory>
#include <cstdlib>

View File

@ -12,6 +12,9 @@
// function();
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -12,6 +12,9 @@
// function(nullptr_t);
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -12,6 +12,9 @@
// function& operator=(nullptr_t);
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -12,6 +12,9 @@
// R operator()(ArgTypes... args) const
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -13,6 +13,9 @@
// template<class F, class A> void assign(F&&, const A&);
// This call was removed post-C++14
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -12,6 +12,9 @@
// void swap(function& other);
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -22,6 +22,9 @@
// template <MoveConstructible R, MoveConstructible ... ArgTypes>
// bool operator!=(nullptr_t, const function<R(ArgTypes...)>&);
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <cassert>

View File

@ -19,6 +19,9 @@
// const T*
// target() const;
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <new>
#include <cstdlib>

View File

@ -12,6 +12,9 @@
// const std::type_info& target_type() const;
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <typeinfo>
#include <cassert>

View File

@ -21,6 +21,9 @@
// ...
// };
// This test runs in C++03, but we have deprecated using std::function in C++03.
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS
#include <functional>
#include <type_traits>

View File

@ -25,6 +25,7 @@ const A source() {return A();}
int main(int, char**)
{
std::reference_wrapper<const A> r = std::ref(source());
(void)r;
return 0;
return 0;
}

View File

@ -297,7 +297,7 @@ int main(int, char**)
#else
static_assert(std::alignment_of<T1>::value >=
TEST_ALIGNOF(natural_alignment), "");
static_assert(std::alignment_of<T1>::value <= 16);
static_assert(std::alignment_of<T1>::value <= 16, "");
static_assert(sizeof(T1) % TEST_ALIGNOF(natural_alignment) == 0, "");
#endif
}