1 //===----------------------------------------------------------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 // <array>
11 
12 // tuple_element<I, array<T, N> >::type
13 
14 // Prevent -Warray-bounds from issuing a diagnostic when testing with clang verify.
15 #if defined(__clang__)
16 #pragma clang diagnostic ignored "-Warray-bounds"
17 #endif
18 
19 #include <array>
20 #include <cassert>
21 
22 
23 // std::array is explicitly allowed to be initialized with A a = { init-list };.
24 // Disable the missing braces warning for this reason.
25 #include "disable_missing_braces_warning.h"
26 
main()27 int main()
28 {
29     {
30         typedef double T;
31         typedef std::array<T, 3> C;
32         std::tuple_element<3, C> foo; // expected-note {{requested here}}
33         // expected-error-re@array:* {{static_assert failed{{( due to requirement '3U[L]{0,2} < 3U[L]{0,2}')?}} "Index out of bounds in std::tuple_element<> (std::array)"}}
34     }
35 }
36