From 192622dc49d3f7fe31d6512d0e85fd03fbb39a62 Mon Sep 17 00:00:00 2001 From: Eric Fiselier Date: Sun, 4 Feb 2018 02:17:02 +0000 Subject: Make array non-CopyAssignable and make swap and fill ill-formed. The standard isn't exactly clear how std::array should handle zero-sized arrays with const element types. In particular W.R.T. copy assignment, swap, and fill. This patch takes the position that those operations should be ill-formed, and makes changes to libc++ to make it so. This follows up on commit r324182. llvm-svn: 324185 --- .../test/std/containers/sequences/array/array.data/data.pass.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libcxx/test/std/containers/sequences/array/array.data') diff --git a/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp b/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp index 7b510c203f8..452d6b7f3ca 100644 --- a/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp +++ b/libcxx/test/std/containers/sequences/array/array.data/data.pass.cpp @@ -36,6 +36,14 @@ int main() T* p = c.data(); (void)p; // to placate scan-build } + { + typedef double T; + typedef std::array C; + C c = {}; + const T* p = c.data(); + static_assert((std::is_same::value), ""); + (void)p; // to placate scan-build + } { struct NoDefault { NoDefault(int) {} -- cgit v1.2.3