[all-commits] [llvm/llvm-project] c91f83: [libc++][mdspan] Fix `mdspan::operator[]` bounds c...

eiytoq via All-commits all-commits at lists.llvm.org
Tue May 5 00:52:55 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c91f835d7a87f13eff2b715aa1171f5094f0a20a
      https://github.com/llvm/llvm-project/commit/c91f835d7a87f13eff2b715aa1171f5094f0a20a
  Author: eiytoq <eiytoq at outlook.com>
  Date:   2026-05-05 (Tue, 05 May 2026)

  Changed paths:
    M libcxx/docs/Status/Cxx2cIssues.csv
    M libcxx/include/__mdspan/extents.h
    M libcxx/include/__mdspan/mdspan.h
    M libcxx/test/libcxx/containers/views/mdspan/mdspan/assert.index_operator.pass.cpp
    M libcxx/test/std/containers/views/mdspan/mdspan/index_operator.pass.cpp

  Log Message:
  -----------
  [libc++][mdspan] Fix `mdspan::operator[]` bounds checking and implement LWG4020 (#192269)

This example fails to compile with libc++ in hardened mode without this
fix.
```c++
#include <mdspan>

struct RValueInt {
  constexpr operator int() && noexcept { return 0; }
};

int main() {
  int data[1] = {42};
  std::mdspan m(data, std::extents<int, 1>{1});

  m[RValueInt{}];
}
```

Fixes: #171311



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list