diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-04 22:11:41 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-04 22:11:41 +0000 |
| commit | cb08bb04c85c6dcd3d951725505317c31eeff323 (patch) | |
| tree | affc3d589de957aeb81a9ba2d0849e2bddde7861 /test/std/containers/sequences/array/array.data/data_const.pass.cpp | |
| parent | 53a420fba21cf1644972b34dcd811a43cdb8368d (diff) | |
Notes
Diffstat (limited to 'test/std/containers/sequences/array/array.data/data_const.pass.cpp')
| -rw-r--r-- | test/std/containers/sequences/array/array.data/data_const.pass.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/std/containers/sequences/array/array.data/data_const.pass.cpp b/test/std/containers/sequences/array/array.data/data_const.pass.cpp index 58840e940899..5be082eeb843 100644 --- a/test/std/containers/sequences/array/array.data/data_const.pass.cpp +++ b/test/std/containers/sequences/array/array.data/data_const.pass.cpp @@ -14,6 +14,8 @@ #include <array> #include <cassert> +#include "test_macros.h" + // std::array is explicitly allowed to be initialized with A a = { init-list };. // Disable the missing braces warning for this reason. #include "disable_missing_braces_warning.h" @@ -36,4 +38,16 @@ int main() const T* p = c.data(); (void)p; // to placate scan-build } +#if TEST_STD_VER > 14 + { + typedef std::array<int, 5> C; + constexpr C c1{0,1,2,3,4}; + constexpr const C c2{0,1,2,3,4}; + + static_assert ( c1.data() == &c1[0], ""); + static_assert ( *c1.data() == c1[0], ""); + static_assert ( c2.data() == &c2[0], ""); + static_assert ( *c2.data() == c2[0], ""); + } +#endif } |
