Files
clang-p2996/libcxx/test/std/containers/sequences/array/array.creation/to_array.fail.cpp
Marek Kurdej 86aae78268 [libc++] [P0325] Implement to_array from LFTS with updates.
Summary:
This patch implements https://wg21.link/P0325.
Please mind that at it is my first contribution to libc++, so I may have forgotten to abide to some conventions.

Reviewers: EricWF, mclow.lists, ldionne, lichray

Reviewed By: ldionne, lichray

Subscribers: lichray, dexonsmith, zoecarver, christof, ldionne, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D69882
2020-01-30 13:38:37 +01:00

35 lines
847 B
C++

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
// <array>
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
#include <array>
#include "test_macros.h"
#include "MoveOnly.h"
int main(int, char**) {
{
char source[3][6] = {"hi", "world"};
std::to_array(source); // expected-error {{here}}
}
{
MoveOnly mo[] = {MoveOnly{3}};
std::to_array(mo); // expected-error {{here}}
}
{
const MoveOnly cmo[] = {MoveOnly{3}};
std::to_array(std::move(cmo)); // expected-error {{here}}
}
return 0;
}