[libc++] Remove more test-suite workarounds for unsupported GCC versions

Differential Revision: https://reviews.llvm.org/D108466
This commit is contained in:
Louis Dionne 2021-08-20 11:39:46 -04:00
parent 4bef7a8ff1
commit 3a244fcf29
8 changed files with 5 additions and 27 deletions

View File

@ -23,7 +23,7 @@
// Ignore warnings about volatile in parameters being deprecated.
// We know it is, but we still have to test it.
#if defined(__GNUC__) && (__GNUC__ >= 10) && !defined(__clang__)
#if defined(TEST_COMPILER_GCC)
# pragma GCC diagnostic ignored "-Wvolatile"
#endif

View File

@ -39,11 +39,7 @@ void test_const_lvalue_get() {
{
using V = std::variant<int, const long>;
constexpr V v(42);
#ifdef TEST_WORKAROUND_CONSTEXPR_IMPLIES_NOEXCEPT
ASSERT_NOEXCEPT(std::get<0>(v));
#else
ASSERT_NOT_NOEXCEPT(std::get<0>(v));
#endif
ASSERT_SAME_TYPE(decltype(std::get<0>(v)), const int &);
static_assert(std::get<0>(v) == 42, "");
}
@ -57,11 +53,7 @@ void test_const_lvalue_get() {
{
using V = std::variant<int, const long>;
constexpr V v(42l);
#ifdef TEST_WORKAROUND_CONSTEXPR_IMPLIES_NOEXCEPT
ASSERT_NOEXCEPT(std::get<1>(v));
#else
ASSERT_NOT_NOEXCEPT(std::get<1>(v));
#endif
ASSERT_SAME_TYPE(decltype(std::get<1>(v)), const long &);
static_assert(std::get<1>(v) == 42, "");
}

View File

@ -33,11 +33,7 @@ void test_const_lvalue_get() {
{
using V = std::variant<int, const long>;
constexpr V v(42);
#ifdef TEST_WORKAROUND_CONSTEXPR_IMPLIES_NOEXCEPT
ASSERT_NOEXCEPT(std::get<int>(v));
#else
ASSERT_NOT_NOEXCEPT(std::get<int>(v));
#endif
ASSERT_SAME_TYPE(decltype(std::get<int>(v)), const int &);
static_assert(std::get<int>(v) == 42, "");
}
@ -51,11 +47,7 @@ void test_const_lvalue_get() {
{
using V = std::variant<int, const long>;
constexpr V v(42l);
#ifdef TEST_WORKAROUND_CONSTEXPR_IMPLIES_NOEXCEPT
ASSERT_NOEXCEPT(std::get<const long>(v));
#else
ASSERT_NOT_NOEXCEPT(std::get<const long>(v));
#endif
ASSERT_SAME_TYPE(decltype(std::get<const long>(v)), const long &);
static_assert(std::get<const long>(v) == 42, "");
}

View File

@ -25,10 +25,4 @@
# endif
#endif
#if defined(TEST_COMPILER_GCC)
# if __GNUC__ < 9
# define TEST_WORKAROUND_CONSTEXPR_IMPLIES_NOEXCEPT // GCC-87603
# endif
#endif
#endif // SUPPORT_TEST_WORKAROUNDS_H

View File

@ -18,7 +18,7 @@
// bases.
#if defined(__clang__)
# pragma clang diagnostic ignored "-Winaccessible-base"
#elif defined(__GNUC__) && (__GNUC__ >= 10)
#elif defined(__GNUC__)
# pragma GCC diagnostic ignored "-Winaccessible-base"
#endif

View File

@ -13,7 +13,7 @@
// bases.
#if defined(__clang__)
# pragma clang diagnostic ignored "-Winaccessible-base"
#elif defined(__GNUC__) && (__GNUC__ >= 10)
#elif defined(__GNUC__)
# pragma GCC diagnostic ignored "-Winaccessible-base"
#endif

View File

@ -13,7 +13,7 @@
// bases.
#if defined(__clang__)
# pragma clang diagnostic ignored "-Winaccessible-base"
#elif defined(__GNUC__) && (__GNUC__ >= 10)
#elif defined(__GNUC__)
# pragma GCC diagnostic ignored "-Winaccessible-base"
#endif

View File

@ -14,7 +14,7 @@
#include <stdio.h>
// Suppress diagnostics about deprecated volatile operations
#if defined(__GNUC__) && (__GNUC__ >= 10) && !defined(__clang__)
#if defined(__GNUC__) && !defined(__clang__)
# pragma GCC diagnostic ignored "-Wvolatile"
#endif