[PowerPC][NFC] Cleanup PPCCTRLoopsVerify pass
[llvm-project.git] / libcxx / test / std / containers / sequences / array / array.swap / swap.fail.cpp
blob37be51e3acf9dea895166a374e5e731ea1a5d761
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 // GCC 5 does not evaluate static assertions dependent on a template parameter.
10 // UNSUPPORTED: gcc-5
12 // <array>
14 // void swap(array& a);
16 #include <array>
17 #include <cassert>
19 // std::array is explicitly allowed to be initialized with A a = { init-list };.
20 // Disable the missing braces warning for this reason.
21 #include "disable_missing_braces_warning.h"
23 int main(int, char**) {
25 typedef double T;
26 typedef std::array<const T, 0> C;
27 C c = {};
28 C c2 = {};
29 // expected-error-re@array:* {{static_assert failed {{.*}}"cannot swap zero-sized array of type 'const T'"}}
30 c.swap(c2); // expected-note {{requested here}}
33 return 0;