[libcxx-commits] [PATCH] D156181: [libc++] Categorize mdspan assertions, and move assertions tests

Christian Trott via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jul 24 15:56:50 PDT 2023


crtrott created this revision.
crtrott added a project: libc++.
Herald added a subscriber: arphaman.
Herald added a project: All.
crtrott requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

Categorize most of the mdspan related assertions as valid_element_access, since almost all of them in some way or another prevent direct, or later undetectable out of bounds accesses. For the vast majority of assertions I added comments explaining how they could lead to out of bounds access issues.

Also moved all the assertions tests from libcxx/test/std to libcxx/test/libcxx


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D156181

Files:
  libcxx/include/__mdspan/extents.h
  libcxx/include/__mdspan/layout_left.h
  libcxx/include/__mdspan/layout_right.h
  libcxx/include/__mdspan/mdspan.h
  libcxx/test/libcxx/containers/views/mdspan/extents/assert.conversion.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/extents/assert.obs.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.conversion.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/layout_left/assert.stride.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.conversion.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/layout_right/assert.stride.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.conversion.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.index_operator.pass.cpp
  libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.size.pass.cpp
  libcxx/test/std/containers/views/mdspan/extents/assert.conversion.pass.cpp
  libcxx/test/std/containers/views/mdspan/extents/assert.ctor_from_array.pass.cpp
  libcxx/test/std/containers/views/mdspan/extents/assert.ctor_from_integral.pass.cpp
  libcxx/test/std/containers/views/mdspan/extents/assert.ctor_from_span.pass.cpp
  libcxx/test/std/containers/views/mdspan/extents/assert.obs.pass.cpp
  libcxx/test/std/containers/views/mdspan/layout_left/assert.conversion.pass.cpp
  libcxx/test/std/containers/views/mdspan/layout_left/assert.ctor.extents.pass.cpp
  libcxx/test/std/containers/views/mdspan/layout_left/assert.ctor.layout_right.pass.cpp
  libcxx/test/std/containers/views/mdspan/layout_left/assert.index_operator.pass.cpp
  libcxx/test/std/containers/views/mdspan/layout_left/assert.stride.pass.cpp
  libcxx/test/std/containers/views/mdspan/layout_right/assert.conversion.pass.cpp
  libcxx/test/std/containers/views/mdspan/layout_right/assert.ctor.extents.pass.cpp
  libcxx/test/std/containers/views/mdspan/layout_right/assert.ctor.layout_left.pass.cpp
  libcxx/test/std/containers/views/mdspan/layout_right/assert.index_operator.pass.cpp
  libcxx/test/std/containers/views/mdspan/layout_right/assert.stride.pass.cpp
  libcxx/test/std/containers/views/mdspan/mdspan/assert.conversion.pass.cpp
  libcxx/test/std/containers/views/mdspan/mdspan/assert.index_operator.pass.cpp
  libcxx/test/std/containers/views/mdspan/mdspan/assert.size.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D156181.543732.patch
Type: text/x-patch
Size: 29465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20230724/e306b523/attachment-0001.bin>


More information about the libcxx-commits mailing list