[PowerPC] Collect some CallLowering arguments into a struct. [NFC]
[llvm-project.git] / libcxx / test / std / containers / sequences / array / array.tuple / get.fail.cpp
blob7bfe670b20d4b58d70734133dbc25d22f1777e7b
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 //===----------------------------------------------------------------------===//
9 // <array>
11 // template <size_t I, class T, size_t N> T& get(array<T, N>& a);
13 // Prevent -Warray-bounds from issuing a diagnostic when testing with clang verify.
14 #if defined(__clang__)
15 #pragma clang diagnostic ignored "-Warray-bounds"
16 #endif
18 #include <array>
19 #include <cassert>
22 // std::array is explicitly allowed to be initialized with A a = { init-list };.
23 // Disable the missing braces warning for this reason.
24 #include "disable_missing_braces_warning.h"
26 int main(int, char**)
29 typedef double T;
30 typedef std::array<T, 3> C;
31 C c = {1, 2, 3.5};
32 std::get<3>(c) = 5.5; // 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::get<> (std::array)"}}
36 return 0;