diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a6d2bab06..b9f6cbb65 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -28,6 +28,7 @@ jobs: - {os: ubuntu-22.04, compiler: gcc, version: '12', name: c++17, flags: -DCPP17=ON} - {os: ubuntu-22.04, compiler: gcc, version: '12', name: xsimd-tbb, flags: -DXTENSOR_USE_XSIMD=ON -DXTENSOR_USE_TBB=ON} - {os: ubuntu-22.04, compiler: gcc, version: '12', name: tbb, flags: -DXTENSOR_USE_TBB=ON -DTBB_INCLUDE_DIR=$CONDA_PREFIX/include -DTBB_LIBRARY=$CONDA_PREFIX/lib} + - {os: ubuntu-22.04, compiler: gcc, version: '12', name: c++20, flags: -DCPP20=ON} runs-on: ${{ matrix.sys.os }} steps: - name: Setup GCC diff --git a/include/xtensor/xutils.hpp b/include/xtensor/xutils.hpp index 46929cb84..746121598 100644 --- a/include/xtensor/xutils.hpp +++ b/include/xtensor/xutils.hpp @@ -838,7 +838,7 @@ namespace xt using base_type::deallocate; // Construct and destroy are removed in --std=c++-20 -#if ((defined(__cplusplus) && __cplusplus < 202002L) || (defined(_MSVC_LANG) && _MSVC_LANG < 202002L)) +#if (__cplusplus < 202002L && !defined(_MSVC_LANG)) || (defined(_MSVC_LANG) && _MSVC_LANG < 202002L) using base_type::construct; using base_type::destroy; #endif diff --git a/test/test_xdynamic_view.cpp b/test/test_xdynamic_view.cpp index abe1b2334..6a0256af2 100644 --- a/test/test_xdynamic_view.cpp +++ b/test/test_xdynamic_view.cpp @@ -215,7 +215,8 @@ namespace xt auto nas2 = nau.convert(); EXPECT_EQ(nas2, nas); - xkeep_slice ks({2, 3, -1}); + auto keep_index = {2, 3, -1}; + xkeep_slice ks(keep_index); ks.normalize(6); xkeep_slice ku(ks); EXPECT_EQ(ku.size(), std::size_t(3)); @@ -227,9 +228,10 @@ namespace xt EXPECT_TRUE(ku.contains(5)); auto ks2 = ku.convert(); - EXPECT_EQ(ks2, ks); + EXPECT_EQ(ks2, xkeep_slice(keep_index)); - xdrop_slice ds({2, 3, -1}); + auto drop_index = {2, 3, -1}; + xdrop_slice ds(drop_index); ds.normalize(6); xdrop_slice du(ds); EXPECT_EQ(du.size(), std::size_t(3)); @@ -241,7 +243,7 @@ namespace xt EXPECT_FALSE(du.contains(5)); auto ds2 = du.convert(); - EXPECT_EQ(ds2, ds); + EXPECT_EQ(ds2, xdrop_slice(drop_index)); } TEST(xdynamic_view, compilation_linux_issue_1349)