| 1 |
//===----------------------------------------------------------------------===// |
| 2 |
// |
| 3 |
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 |
// See https://llvm.org/LICENSE.txt for license information. |
| 5 |
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 |
// |
| 7 |
//===----------------------------------------------------------------------===// |
| 8 |
|
| 9 |
// <utility> |
| 10 |
|
| 11 |
// template<class T, T N> |
| 12 |
// using make_integer_sequence = integer_sequence<T, 0, 1, ..., N-1>; |
| 13 |
|
| 14 |
// UNSUPPORTED: c++03, c++11 |
| 15 |
|
| 16 |
// This test hangs during recursive template instantiation with libstdc++ |
| 17 |
// UNSUPPORTED: stdlib=libstdc++ |
| 18 |
|
| 19 |
#include <utility> |
| 20 |
|
| 21 |
#include "test_macros.h" |
| 22 |
|
| 23 |
typedef std::make_integer_sequence<int, -3> MakeSeqT; |
| 24 |
|
| 25 |
// std::make_integer_sequence is implemented using a compiler builtin if available. |
| 26 |
// this builtin has different diagnostic messages than the fallback implementation. |
| 27 |
#if TEST_HAS_BUILTIN(__make_integer_seq) |
| 28 |
MakeSeqT i; // expected-error@*:* {{integer sequences must have non-negative sequence length}} |
| 29 |
#else |
| 30 |
MakeSeqT i; // expected-error-re@*:* {{static assertion failed{{.*}}std::make_integer_sequence must have a non-negative sequence length}} |
| 31 |
#endif |