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 // <array> 10 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17 11 12 #include <array> 13 14 #include "test_macros.h" 15 #include "MoveOnly.h" 16 17 int main(int, char**) { 18 { 19 char source[3][6] = {"hi", "world"}; 20 // expected-error@array:* {{to_array does not accept multidimensional arrays}} 21 // expected-error@array:* {{to_array requires copy constructible elements}} 22 // expected-error@array:* 3 {{cannot initialize}} 23 // expected-error@array:* 0+ {{suggest braces}} 24 std::to_array(source); // expected-note {{requested here}} 25 } 26 27 { 28 MoveOnly mo[] = {MoveOnly{3}}; 29 // expected-error@array:* {{to_array requires copy constructible elements}} 30 // expected-error@array:* {{calling a private constructor}} 31 std::to_array(mo); // expected-note {{requested here}} 32 } 33 34 { 35 const MoveOnly cmo[] = {MoveOnly{3}}; 36 // expected-error@array:* {{to_array requires move constructible elements}} 37 // expected-error@array:* {{calling a private constructor}} 38 std::to_array(std::move(cmo)); // expected-note {{requested here}} 39 } 40 41 return 0; 42 } 43