diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:58 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-01-02 19:18:58 +0000 |
| commit | 53a420fba21cf1644972b34dcd811a43cdb8368d (patch) | |
| tree | 66a19f6f8b65215772549a51d688492ab8addc0d /test/std/containers/sequences/array | |
| parent | b50f1549701eb950921e5d6f2e55ba1a1dadbb43 (diff) | |
Notes
Diffstat (limited to 'test/std/containers/sequences/array')
| -rw-r--r-- | test/std/containers/sequences/array/array.tuple/get.fail.cpp | 5 | ||||
| -rw-r--r-- | test/std/containers/sequences/array/at.pass.cpp | 17 | ||||
| -rw-r--r-- | test/std/containers/sequences/array/iterators.pass.cpp | 4 |
3 files changed, 17 insertions, 9 deletions
diff --git a/test/std/containers/sequences/array/array.tuple/get.fail.cpp b/test/std/containers/sequences/array/array.tuple/get.fail.cpp index 13323dd8e519..45e1d2b46b0f 100644 --- a/test/std/containers/sequences/array/array.tuple/get.fail.cpp +++ b/test/std/containers/sequences/array/array.tuple/get.fail.cpp @@ -19,7 +19,6 @@ #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. @@ -32,10 +31,6 @@ int main() typedef std::array<T, 3> C; C c = {1, 2, 3.5}; std::get<3>(c) = 5.5; // expected-note {{requested here}} -#if TEST_STD_VER >= 11 // expected-error@array:* {{static_assert failed "Index out of bounds in std::get<> (std::array)"}} -#else - // expected-error@array:* {{implicit instantiation of undefined template '__static_assert_test<false>'}} -#endif } } diff --git a/test/std/containers/sequences/array/at.pass.cpp b/test/std/containers/sequences/array/at.pass.cpp index 9707beeb3946..29483153d4ab 100644 --- a/test/std/containers/sequences/array/at.pass.cpp +++ b/test/std/containers/sequences/array/at.pass.cpp @@ -7,7 +7,6 @@ // //===----------------------------------------------------------------------===// -// XFAIL: libcpp-no-exceptions // <array> // reference operator[] (size_type) @@ -40,8 +39,14 @@ int main() r2 = 7.5; assert(c.back() == 7.5); - try { (void) c.at(3); } +#ifndef TEST_HAS_NO_EXCEPTIONS + try + { + (void) c.at(3); + assert(false); + } catch (const std::out_of_range &) {} +#endif } { typedef double T; @@ -53,8 +58,14 @@ int main() C::const_reference r2 = c.at(2); assert(r2 == 3.5); - try { (void) c.at(3); } +#ifndef TEST_HAS_NO_EXCEPTIONS + try + { + (void) c.at(3); + assert(false); + } catch (const std::out_of_range &) {} +#endif } #if TEST_STD_VER > 11 diff --git a/test/std/containers/sequences/array/iterators.pass.cpp b/test/std/containers/sequences/array/iterators.pass.cpp index 233e9328c4ed..1f9904e1fa71 100644 --- a/test/std/containers/sequences/array/iterators.pass.cpp +++ b/test/std/containers/sequences/array/iterators.pass.cpp @@ -15,6 +15,8 @@ #include <iterator> #include <cassert> +#include "test_macros.h" + int main() { { @@ -36,7 +38,7 @@ int main() assert(i == j); } -#if _LIBCPP_STD_VER > 11 +#if TEST_STD_VER > 11 { // N3644 testing { typedef std::array<int, 5> C; |
