1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 // GCC 5 does not evaluate static assertions dependent on a template parameter.
14 // void swap(array& a);
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**) {
26 typedef std::array
<const T
, 0> C
;
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}}