[libc++] Move all the remaining .fail.cpp tests to .verify.cpp

I made sure they all had some expected-error output in them. Many of
these tests would be better implemented as a positive test using SFINAE,
but this is beyond the scope of this patch.

Differential Revision: https://reviews.llvm.org/D153980
This commit is contained in:
Louis Dionne 2023-06-16 11:04:06 -04:00
parent 60a6a0d17a
commit b82dcb624e
87 changed files with 12 additions and 15 deletions

View File

@ -17,22 +17,15 @@
// UNSUPPORTED: stdlib=libstdc++
#include <utility>
#include <type_traits>
#include <cassert>
#include "test_macros.h"
int main(int, char**)
{
typedef std::make_integer_sequence<int, -3> MakeSeqT;
typedef std::make_integer_sequence<int, -3> MakeSeqT;
// std::make_integer_sequence is implemented using a compiler builtin if available.
// this builtin has different diagnostic messages than the fallback implementation.
#if TEST_HAS_BUILTIN(__make_integer_seq) && !defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
MakeSeqT i; // expected-error@*:* {{integer sequences must have non-negative sequence length}}
// std::make_integer_sequence is implemented using a compiler builtin if available.
// this builtin has different diagnostic messages than the fallback implementation.
#if TEST_HAS_BUILTIN(__make_integer_seq)
MakeSeqT i; // expected-error@*:* {{integer sequences must have non-negative sequence length}}
#else
MakeSeqT i; // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}std::make_integer_sequence must have a non-negative sequence length}}
MakeSeqT i; // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}std::make_integer_sequence must have a non-negative sequence length}}
#endif
return 0;
}

View File

@ -16,5 +16,9 @@
// This test hangs during recursive template instantiation with libstdc++
// UNSUPPORTED: stdlib=libstdc++
#define _LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE
#include "make_integer_seq.fail.cpp"
// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE
#include <utility>
typedef std::make_integer_sequence<int, -3> MakeSeqT;
MakeSeqT i; // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{.*}}std::make_integer_sequence must have a non-negative sequence length}}