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 // GCC 5 does not evaluate static assertions dependent on a template parameter.
10 // UNSUPPORTED: gcc-5
11 
12 // <array>
13 
14 // void fill(const T& u);
15 
16 #include <array>
17 #include <cassert>
18 
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"
22 
main(int,char **)23 int main(int, char**) {
24   {
25     typedef double T;
26     typedef std::array<const T, 0> C;
27     C c = {};
28     // expected-error-re@array:* {{static_assert failed {{.*}}"cannot fill zero-sized array of type 'const T'"}}
29     c.fill(5.5); // expected-note {{requested here}}
30   }
31 
32   return 0;
33 }
34