summaryrefslogtreecommitdiffstats
path: root/libcxx/test/containers/sequences/array
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2012-07-20 19:20:49 +0000
committerHoward Hinnant <hhinnant@apple.com>2012-07-20 19:20:49 +0000
commit397717b7c8b7576fbdd2f5b7ec7dec531f305c98 (patch)
tree295377c332bdaf674ea305490ac69bdf38535a0a /libcxx/test/containers/sequences/array
parent931644bfec6122fffc436b9a2bfddf4dce847c76 (diff)
downloadbcm5719-llvm-397717b7c8b7576fbdd2f5b7ec7dec531f305c98.tar.gz
bcm5719-llvm-397717b7c8b7576fbdd2f5b7ec7dec531f305c98.zip
constexpr applied to <array>.
llvm-svn: 160564
Diffstat (limited to 'libcxx/test/containers/sequences/array')
-rw-r--r--libcxx/test/containers/sequences/array/array.size/size.pass.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/libcxx/test/containers/sequences/array/array.size/size.pass.cpp b/libcxx/test/containers/sequences/array/array.size/size.pass.cpp
index 87344ae5373..4078fd5ca9f 100644
--- a/libcxx/test/containers/sequences/array/array.size/size.pass.cpp
+++ b/libcxx/test/containers/sequences/array/array.size/size.pass.cpp
@@ -28,4 +28,18 @@ int main()
C c = {};
assert(c.size() == 0);
}
+#ifndef _LIBCPP_HAS_NO_CONSTEXPR
+ {
+ typedef double T;
+ typedef std::array<T, 3> C;
+ constexpr C c = {1, 2, 3.5};
+ static_assert(c.size() == 3, "");
+ }
+ {
+ typedef double T;
+ typedef std::array<T, 0> C;
+ constexpr C c = {};
+ static_assert(c.size() == 0, "");
+ }
+#endif
}
OpenPOWER on IntegriCloud