From eda6b8dd83f26aa22748f35f3ab2d3cfe543f181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Wed, 10 May 2023 22:16:00 +0200 Subject: [PATCH] Correct testcase that was failing in GCC-12 --- test/static_vector_test.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/test/static_vector_test.cpp b/test/static_vector_test.cpp index 3046c69..c7c571f 100644 --- a/test/static_vector_test.cpp +++ b/test/static_vector_test.cpp @@ -633,16 +633,14 @@ bool default_init_test()//Test for default initialization di_vector_t v(Capacity, default_init); } { - di_vector_t v; + typename dtl::aligned_storage::type as; + di_vector_t& v = *::new(as.data) di_vector_t; int *p = v.data(); for(std::size_t i = 0; i != Capacity; ++i, ++p){ *p = static_cast(i); } - //Destroy the vector, p still pointing to the storage - v.~di_vector_t(); - di_vector_t &rv = *::new(&v)di_vector_t(Capacity, default_init); di_vector_t::iterator it = rv.begin();